Flaky Test: media/video-ended-event-negative-playback.html
https://bugs.webkit.org/show_bug.cgi?id=134490

* platform/mac/TestExpectations: Marking as such.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171185 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Some inspector-protocol test expectations gardening.

Moved cross-platform expectations for inspector-protocol/debugger/setBreakpoint-dfg*
tests to a cross-platform file, and added a Mac expectation for
inspector-protocol/profiler/console-profile.html.

* TestExpectations:
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171186 268f45cc-cd09-0410-ab3c-d52691b4dbfc
plugins/quicktime-plugin-replacement.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=135015

* platform/mac/TestExpectations: Marked as such.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171187 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Don't send geolocation permission requests when the page is not visible
<rdar://problem/17208715>
https://bugs.webkit.org/show_bug.cgi?id=134989

Reviewed by Darin Adler.

Instead of eagerly requesting geolocation permission for pages that aren't visible,
store a set of pending requests, and send them only once the page has become visible.

* Modules/geolocation/GeolocationController.cpp:
(WebCore::GeolocationController::GeolocationController):
(WebCore::GeolocationController::~GeolocationController):
(WebCore::GeolocationController::requestPermission):
(WebCore::GeolocationController::cancelPermissionRequest):
(WebCore::GeolocationController::viewStateDidChange):
(WebCore::provideGeolocationTo):
* Modules/geolocation/GeolocationController.h:
Store pending requests to be fired once the page is visible.

* WebCore.xcodeproj/project.pbxproj:
Add ViewStateChangeObserver.h

* page/Page.cpp:
(WebCore::Page::addViewStateChangeObserver):
(WebCore::Page::removeViewStateChangeObserver):
(WebCore::Page::setViewState):
* page/Page.h:
Add a set of registered view state observers, and notify them when the
view state changes.

* page/ViewStateChangeObserver.h: Added.
(WebCore::ViewStateChangeObserver::~ViewStateChangeObserver):
Add an observer that can register with the page for view state changes.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171188 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DFG Flush(SetLocal) store elimination is overzealous for captured variables in the presence of nodes that have no effects but may throw
https://bugs.webkit.org/show_bug.cgi?id=134988
<rdar://problem/17706349>

Reviewed by Oliver Hunt.
        
Luckily, we also don't need this optimization to be super powerful: the only place
where it really matters is for getting rid of the redundancy between op_enter and
op_init_lazy_reg, and in that case, there is a small set of possible nodes between the
two things. This change updates the store eliminator to know about only that small,
obviously safe, set of nodes over which we can store-eliminate.
        
This shouldn't have any performance impact in the DFG because this optimization kicks
in relatively rarely already. And once we tier up into the FTL, we get a much better
store elimination over LLVM IR, so this really shouldn't matter at all.
        
The tricky part of this patch is that there is a close relative of this optimization,
for uncaptured variables that got flushed. This happens for arguments to inlined calls.
I make this work by splitting it into two different store eliminators.
        
Note that in the process of crafting the tests, I realized that we were incorrectly
DCEing NewArrayWithSize. That's not cool, since that can throw an exception for
negative array sizes. If we ever did want to DCE this node, we'd need to lower the node
to a check node followed by the actual allocation.

* dfg/DFGCSEPhase.cpp:
(JSC::DFG::CSEPhase::uncapturedSetLocalStoreElimination):
(JSC::DFG::CSEPhase::capturedSetLocalStoreElimination):
(JSC::DFG::CSEPhase::setLocalStoreElimination):
(JSC::DFG::CSEPhase::performNodeCSE):
(JSC::DFG::CSEPhase::SetLocalStoreEliminationResult::SetLocalStoreEliminationResult): Deleted.
* dfg/DFGNodeType.h:
* tests/stress/capture-escape-and-throw.js: Added.
(foo.f):
(foo):
* tests/stress/new-array-with-size-throw-exception-and-tear-off-arguments.js: Added.
(foo):
(bar):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171190 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sometimes purgeable (or empty!) tiles are shown on screen when resuming the app
https://bugs.webkit.org/show_bug.cgi?id=135018
<rdar://problem/17615038>

Reviewed by Simon Fraser.

* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::hideContentUntilNextUpdate):
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::hideContentUntilNextUpdate):
* UIProcess/mac/RemoteLayerTreeHost.h:
* UIProcess/mac/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::detachRootLayer):
Add a mechanism to "hide" drawing area content until the next commit,
by detaching the root layer. RemoteLayerTreeHost will automatically reattach
it at the next commit.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::viewStateDidChange):
* UIProcess/WebPageProxy.h:
Add a parameter to viewStateDidChange specifying whether dispatching the change
to the Web process is deferrable or not. We will also automatically use "Immediate" if
the view is coming in-window, like we did before.

* UIProcess/ios/WKContentView.mm:
(-[WKContentView _applicationWillEnterForeground:]):
Make use of the aforementioned new mechanisms to ensure that we immediately dispatch
view state changes when coming into the foreground, and will have removed the root layer
if a commit didn't come in while waitForDidUpdateViewState blocks.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add test for r169820.
        https://bugs.webkit.org/show_bug.cgi?id=135002.

        Reviewed by Dean Jackson.

        * platform/mac-wk2/plugins/snapshotting/autoplay-dominant-blank-plugin-moved-into-view-expected.txt: Added.
        * plugins/snapshotting/autoplay-dominant-blank-plugin-moved-into-view.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171192 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Disable button animations in regression tests
https://bugs.webkit.org/show_bug.cgi?id=133647
<rdar://problem/16677530>

Reviewed by Dean Jackson.

* DumpRenderTree/mac/DumpRenderTree.mm: (setDefaultsToConsistentValuesForTesting):
We already did this for WebKit2, let's do it for WebKit1 too.



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