[WK2] Pinch-zoom shadows can overlap headers and footers
https://bugs.webkit.org/show_bug.cgi?id=134372
<rdar://problem/16004095>

Reviewed by Simon Fraser.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::shadowLayerPositionForFrame):
(WebKit::shadowLayerBoundsForFrame):
Compute the initial shadow layer and shadow bounds exactly as RenderLayerCompositor does
(in updateRootLayerPosition and friends). Also, clip the shadow layer to the old document rect,
otherwise it can extend over top of the header/footers. The content is automatically clipped to
this rect by the root content layer, but the shadow is outside of that.

(WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToLayers):
(WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
Pass all of the arguments to constrainScrollPositionForOverhang, not just half of them.
There's still a bug where we constrain incorrectly with header/footer layers, but that
will be addressed elsewhere.

(WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
Make use of the new helpers.

* WebCore.exp.in:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateLayerForHeader):
(WebCore::RenderLayerCompositor::updateLayerForFooter):
Put header/footer layers in front of the root content layer instead of behind.
Ideally nothing would ever overlap them, but this will give them precedence regardless.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170514 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS][WK2] Implement WKPDFView smart magnification
https://bugs.webkit.org/show_bug.cgi?id=134269
<rdar://problem/17272825>

Reviewed by Dan Bernstein.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _currentContentView]):
(contentZoomScale):
Factor _currentContentView out of contentZoomScale.

(-[WKWebView _zoomToRect:WebCore::atScale:origin:WebCore::]):
(-[WKWebView _scrollToRect:WebCore::origin:WebCore::minimumScrollDistance:]):
(-[WKWebView _contentRectForUserInteraction]):
Use it in a bunch more places so we query the right view when zooming/scrolling for smart magnification.

* UIProcess/ios/WKPDFView.h:
* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView scrollViewDidScroll:]):
(-[WKPDFView _revalidateViews]):
(-[WKPDFView zoom:to:atPoint:kind:]):
(-[WKPDFView resetZoom:]):
Implement zoom:to:atPoint:kind: and resetZoom: UIPDFPageViewDelegate methods.
Convert the rects/points and forward them on to the WKWebView to do the zoom.
resetZoom: doesn't provide the gesture origin, so we zoom out using the view center as our origin.
Avoid parenting new UIPDFPageViews while starting a zoom; they'll end up with a bizarre
animation on them and go flying across the screen (even before _isAnimatingZoom is set).


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170515 268f45cc-cd09-0410-ab3c-d52691b4dbfc
MiniBrowser should support a preference to override the default URL
https://bugs.webkit.org/show_bug.cgi?id=134373

Reviewed by Darin Adler.

* MiniBrowser/mac/AppDelegate.m:
(-[BrowserAppDelegate applicationDidFinishLaunching:]): See if there’s a pref
  overriding the default URL, and use it if there is.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170516 268f45cc-cd09-0410-ab3c-d52691b4dbfc
iOS 8 beta 2 ES6 'Set' clear() broken
https://bugs.webkit.org/show_bug.cgi?id=134346

Reviewed by Oliver Hunt.


Source/JavaScriptCore: 
The object map was not cleared :(.

Kudos to Ashley Gullen for tracking this and making a regression test.
Credit to Oliver for finding the missing code.

* runtime/MapData.h:
(JSC::MapData::clear):

LayoutTests: 
* js/script-tests/set-clear.js: Added.
* js/set-clear-expected.txt: Added.
* js/set-clear.html: Added.


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