Parser statementDepth accounting needs to account for when a function body excludes its braces.
<https://webkit.org/b/133832>

Reviewed by Oliver Hunt.


Source/JavaScriptCore: 
In some cases (e.g. when a Function object is instantiated from a string), the
function body source may not include its braces.  The parser needs to account
for this when calculating its statementDepth.

* bytecode/UnlinkedCodeBlock.cpp:
(JSC::generateFunctionCodeBlock):
(JSC::UnlinkedFunctionExecutable::codeBlockFor):
* bytecode/UnlinkedCodeBlock.h:
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseStatement):
- Also fixed the error message for declaring nested functions in strict mode
  to be more accurate.
* parser/Parser.h:
(JSC::Parser<LexerType>::parse):
(JSC::parse):
* runtime/Executable.cpp:
(JSC::ScriptExecutable::newCodeBlockFor):

LayoutTests: 
* js/parser-syntax-check-expected.txt:
* js/script-tests/parser-syntax-check.js:
  - Added cases for declaring functions in strict mode.
  - Added caught error to the test result logging if it's not a SyntaxError.
    This helps catch the issue in this bug which was erroneously throwing
    RangeErrors.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170034 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS][wk2] Swiping back briefly shows the previous page before loading the new one
https://bugs.webkit.org/show_bug.cgi?id=133885

Reviewed by Simon Fraser.

Remove a race between the UI and Web processes when removing the swipe snapshot.
Previously, it was possible to get a commit from the Web process with layer content
(and render tree size) from the previous page *after* sending the navigation request
to the page, because of the asynchronicity of layer tree commits. This could cause
the snapshot to be removed early (if the previous fully-loaded page had a sufficiently
large render tree size), revealing the old tiles underneath the snapshot.

* Shared/mac/RemoteLayerTreeTransaction.h:
(WebKit::RemoteLayerTreeTransaction::transactionID):
(WebKit::RemoteLayerTreeTransaction::setTransactionID):
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::encode):
(WebKit::RemoteLayerTreeTransaction::decode):
* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::lastVisibleTransactionID):
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
(WebKit::RemoteLayerTreeDrawingAreaProxy::coreAnimationDidCommitLayers):
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::didUpdate):
Keep track of an ever-increasing transaction ID in RemoteLayerTreeDrawingArea(Proxy).
It increments in the UI process at didUpdate time, because the Web process cannot
have started on a new layer tree commit until didUpdate is sent.
It increments in the Web process at commit time.

* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::endSwipeGesture):
(WebKit::ViewGestureController::setRenderTreeSize):
* UIProcess/mac/ViewGestureController.h:
Adopt transaction IDs; don't remove the snapshot until the commit
that includes the navigation arrives.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170035 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS][wk2] Swipe snapshots are removed too quickly if there is no saved render tree size
https://bugs.webkit.org/show_bug.cgi?id=133891

Reviewed by Simon Fraser.

* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::endSwipeGesture):
(WebKit::ViewGestureController::setRenderTreeSize):
If we don't know the target render tree size, wait until the first layer tree commit
that comes in, instead of removing the snapshot when the gesture ends.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] Use TileController on Windows
https://bugs.webkit.org/show_bug.cgi?id=133895

Reviewed by Tim Horton.


../WebCore: 
* WebCore.vcxproj/WebCore.vcxproj: Add Tiled Drawing files.
* WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
* platform/graphics/TiledBacking.h: No longer Cocoa-only.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::swapFromOrToTiledLayer): Windows
now uses the same layer type as Mac.
* platform/graphics/ca/LayerPool.cpp:
(WebCore::LayerPool::takeLayerWithSize): Use nullptr
rather than nil for C++ code.
* platform/graphics/ca/PlatformCALayer.cpp:
* platform/graphics/ca/PlatformCALayer.h: Expose necessary
drawing functions for Windows port.
* platform/graphics/ca/TileController.cpp: Remove unneeded
header include for WebLayer.
* platform/graphics/ca/TileCoverageMap.cpp: Correct #includes.
* platform/graphics/ca/TileGrid.h: Not just for Cococa.
* platform/graphics/ca/mac/PlatformCALayerMac.mm: Remove
extra whitespace.
* platform/graphics/ca/mac/PlatformCALayerMac.h: Remove
unneeded overload.
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayer::collectRectsToPaint): Added stub.
(PlatformCALayer::drawLayerContents): Added.
(PlatformCALayer::frameForLayer): Added.
(PlatformCALayerWin::PlatformCALayerWin): Remove unneeded
assert now that we support these types. Add TileController
support.
(PlatformCALayerWin::setEdgeAntialiasingMask): Added.
(printLayer): Add newly-supported tile types.
(PlatformCALayerWin::tiledBacking): Added.
* platform/graphics/ca/win/PlatformCALayerWin.h: Update to
support Tiled Drawing.
* platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
(PlatformCALayerWinInternal::PlatformCALayerWinInternal): Update to
recognize newly-supported layer types.
(PlatformCALayerWinInternal::setNeedsDisplay): Ditto.
(PlatformCALayerWinInternal::setSublayers): Ditto.
(PlatformCALayerWinInternal::getSublayers): Ditto.
(PlatformCALayerWinInternal::removeAllSublayers): Ditto.
(PlatformCALayerWinInternal::insertSublayer): Ditto.
(PlatformCALayerWinInternal::sublayerCount): Ditto.
(PlatformCALayerWinInternal::indexOfSublayer): Ditto.
(PlatformCALayerWinInternal::sublayerAtIndex): Ditto.
(PlatformCALayerWinInternal::setBounds): Ditto.
(PlatformCALayerWinInternal::setFrame): Ditto.
(PlatformCALayerWinInternal::drawTile): Ditto.
(PlatformCALayerWinInternal::createTileController): Ditto.
(PlatformCALayerWinInternal::tiledBacking): Ditto.
* platform/graphics/ca/win/PlatformCALayerWinInternal.h: Update to use
TileController.

../WebKit2: 
* WebProcess/WebPage/mac/PlatformCALayerRemote.h: Remove
unneeded overload.


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