Remove WKPageSetVisibilityState
https://bugs.webkit.org/show_bug.cgi?id=128551

Reviewed by Anders Carlsson.

Source/WebKit2: 

Made prerender state automatic. We should move this further
up into WebCore, but this requires refactoring for the Page
construction order.

* Shared/API/c/WKDeprecatedFunctions.cpp:
(WKPageSetVisibilityState):
    - deprecated.
* UIProcess/API/C/WKPage.cpp:
    - removed WKPageSetVisibilityState.
* UIProcess/API/C/WKPage.h:
    - removed WKPageSetVisibilityState.
* UIProcess/WebPageProxy.cpp:
    - removed setVisibilityStatePrerender.
* UIProcess/WebPageProxy.h:
    - removed setVisibilityStatePrerender.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
    - removed setVisibilityStatePrerender.
    - When creating a Page, automatically set the prerender state.
* WebProcess/WebPage/WebPage.h:
    - removed setVisibilityStatePrerender.
* WebProcess/WebPage/WebPage.messages.in:
    - removed SetVisibilityStatePrerender.

Tools: 

* TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.mm:
(TestWebKitAPI::PageVisibilityStateWithWindowChanges::initializeView):
(TestWebKitAPI::PageVisibilityStateWithWindowChanges::runTest):
    - visibilityState of offs-creen WKView is automatically prerender.
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::setHidden):
* WebKitTestRunner/InjectedBundle/InjectedBundle.h:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setPageVisibility):
(WTR::TestRunner::resetPageVisibility):
* WebKitTestRunner/TestController.cpp:
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
    - removed calls to WKPageSetVisibilityState.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163821 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move animation tests that have similar failing behavior in debug builds together,
and mark them as passing in release.

* platform/mac/TestExpectations:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163822 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Disable access to application cache when in private browsing
https://bugs.webkit.org/show_bug.cgi?id=128426

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Tests: http/tests/security/appcache-in-private-browsing.html
       http/tests/security/appcache-switching-private-browsing.html

* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::cacheForMainRequest):
(WebCore::ApplicationCacheGroup::selectCache):
(WebCore::ApplicationCacheGroup::selectCacheWithoutManifestURL):
(WebCore::ApplicationCacheGroup::update):
* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::ApplicationCacheHost::isApplicationCacheEnabled):

LayoutTests:

* http/tests/security/appcache-in-private-browsing-expected.txt: Added.
* http/tests/security/appcache-in-private-browsing.html: Added.
* http/tests/security/appcache-switching-private-browsing-expected.txt: Added.
* http/tests/security/appcache-switching-private-browsing.html: Added.
* http/tests/security/resources/frame-for-appcache-in-private-browsing.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163823 268f45cc-cd09-0410-ab3c-d52691b4dbfc
svg/text/text-overflow-ellipsis-svgfont-kerning-ligatures.html frequently asserts
in ComplexTextController::offsetForPosition
https://bugs.webkit.org/show_bug.cgi?id=119747

* platform/mac/TestExpectations: Skipped it in debug builds.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
HTMLTextFormControlElement::setSelectionRange shouldn't use VisiblePosition
https://bugs.webkit.org/show_bug.cgi?id=128478

Reviewed by Darin Adler.

Added positionForIndex to compute Position given a selection index. This function doesn't
synchronously trigger like visiblePositionForIndex.

Also added assertions in visiblePositionForIndex and visiblePositionForIndex to make sure
they are inverse of one another.

* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::setSelectionRange): Use positionForIndex. Also removed
the now tautological assertions since we would never create a position outside the inner text
element.

(WebCore::HTMLTextFormControlElement::indexForVisiblePosition): Fixed the bug where this
function could return a selection index beyond innerTextElement in some types of input
elements such as search fields. fast/forms/search-disabled-readonly.html hits the newly
added assertion without this change. Note we can't use visiblePositionForIndex here as that
would result in a mutual recursion with the assertion in visiblePositionForIndex.

(WebCore::HTMLTextFormControlElement::visiblePositionForIndex): Added an assertion.

(WebCore::positionForIndex): Added. It's here with prototype at the beginning of the file
so that it's right next to HTMLTextFormControlElement::innerText() where we do a similar
DOM traversal to obtain the inner text value.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163825 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed EFL WebKit2 build fix after r163816.

* CMakeLists.txt: Remove HTMLMediaSource.cpp

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163826 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed GTK build fix after r163816.

* GNUmakefile.list.am: Remove HTMLMediaSource.h and HTMLMediaSource.cpp

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r163660-r163664): js/dom/stack-trace.html fails.
<https://webkit.org/b/128544>

Reviewed by Alexey Proskuryakov.

The failing test is fragile. The test intends to test a recursion pattern
i.e. the top of the stack trace should show a repeated cycle of certain
function calls. However, the test makes a faulty assumption about which
function in that recursion pattern will be the one that overflows the
stack.

The fix is to make the test check for repetition of that recursion pattern
instead of making a specific assumption as to which function within that
recursion pattern will overflow the stack.

* TestExpectations: reverted skipped test.
* js/dom/script-tests/stack-trace.js:
(stackTraceLineFor):
- refactored this code to generated the stack trace line out of printStack.
(printStack):
- updated to use stackTraceLineFor.
(dumpPattern):
- utility function to dump the recursion pattern being matched.
(matchesPatternAtLine):
(matchPattern):
(checkStackForPattern):
- utility functions for testing if the stack trace matches the expected
  recursion pattern. The pattern is an array of stack trace lines that
  we should see repeated in the stack trace starting from the top.

  The top line of the stack trace may match any line in the pattern.
  Thereafter, subsequent lines much patch lines in the pattern starting
  with the line after the first match. When we run out of pattern lines,
  we'll go back to the first pattern line and continue the matching test
  until we run out of stack trace lines to match.

  If any mismatch is found, the test fails.

* js/dom/stack-trace-expected.txt:
- updates baseline for expected results.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163829 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Shapes] Add initial performance tests for polygon shape
https://bugs.webkit.org/show_bug.cgi?id=128554

Reviewed by Ryosuke Niwa.

This patch adds performance testing for simple polygon shape-outside.
The Shapes performance tests directory is skipped by default.

* Layout/Shapes/ShapeOutsideSimplePolygon.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163834 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Put a delegatesScrolling flag on WebPageProxy so that the UI process knows when scrolling is delegated
https://bugs.webkit.org/show_bug.cgi?id=128429

Reviewed by Sam Weinig.

Add delegatesScrolling() which defaults to false, but is set to true for iOS
by WKContentView.

* UIProcess/API/ios/WKContentView.mm:
(-[WKContentView initWithFrame:configuration:]):
(-[WKContentView _commonInitializationWithContextRef:pageGroupRef:relatedToPage:]):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::setDelegatesScrolling):
(WebKit::WebPageProxy::delegatesScrolling):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163836 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Show a debug tile map indicator for UI-side compositing
https://bugs.webkit.org/show_bug.cgi?id=128553

Reviewed by Tim Horton.

Implement a tiled scrolling indicator for UI-side compositing.

The indicator is created by making another RemoteLayerTreeHost,
and decoding the transaction in it a second time to create a cloned
layer tree. In that clone commit, we modify some layer properties to
make things easier to see.

The cloned layer tree is hosted in the root layer of the main
RemoteLayerTreeHost.

RemoteLayerTreeHost was changed to not need a pointer to the WebPageProxy,
which it only used in the "root layer changed" case; instead, it now just
returns a bool from updateLayerTree() in that situation.

* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: Explanatory comment.
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
(WebKit::RemoteLayerTreeDrawingAreaProxy::setExposedRect):
(WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation):
(WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicatorPosition):
(WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorScale):
(WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator):
(WebKit::RemoteLayerTreeDrawingAreaProxy::showDebugIndicator):
* UIProcess/mac/RemoteLayerTreeHost.h:
(WebKit::RemoteLayerTreeHost::rootLayer):
(WebKit::RemoteLayerTreeHost::setIsDebugLayerTreeHost):
(WebKit::RemoteLayerTreeHost::isDebugLayerTreeHost):
* UIProcess/mac/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::RemoteLayerTreeHost):
(WebKit::RemoteLayerTreeHost::updateLayerTree):
(WebKit::RemoteLayerTreeHost::createLayer):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163837 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fail FTL compilation if the required stack is too big
https://bugs.webkit.org/show_bug.cgi?id=128560

Reviewed by Filip Pizlo.

Added StackSize struct to FTLStackMaps and populated it.  Added and updated
related dump functions.  Use the stack size found at the end of the compilation
to compare against the value of a new option, llvmMaxStackSize.  We fail the
compile if the function's stack size is greater than llvmMaxStackSize.

* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::compileInThreadImpl):
* ftl/FTLStackMaps.cpp:
(JSC::FTL::StackMaps::StackSize::parse):
(JSC::FTL::StackMaps::StackSize::dump):
(JSC::FTL::StackMaps::parse):
(JSC::FTL::StackMaps::dump):
(JSC::FTL::StackMaps::dumpMultiline):
(JSC::FTL::StackMaps::getStackSize):
* ftl/FTLStackMaps.h:
* runtime/Options.h:


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