REGRESSION(r156316): Scrollbar on a large document is broken
https://bugs.webkit.org/show_bug.cgi?id=130474
<rdar://problem/16371523>

Reviewed by Anders Carlsson.

The bug was caused by updateArrowPlacement() doing the work even though Scrollbar Overlay API is available.
Prior to r156316, this function exited early:
http://trac.webkit.org/browser/trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.mm?rev=156315#L147

Fixed the bug by deleting updateArrowPlacement() entirely.

* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::preferencesChanged):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165918 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS][MediaControls] Reverse-pinching using the built-in controls should enter full screen
https://bugs.webkit.org/show_bug.cgi?id=129707

Reviewed by Eric Carlson.

The default controls on iOS should respond to a pinch gesture by entering fullscreen. Add a gesture
event listener, and enter full screen if the user does a quick (>2 velocity) reverse (>1.25 scale) pinch.

* Modules/mediacontrols/mediaControlsiOS.js:
(ControllerIOS.prototype.createBase):
(ControllerIOS.prototype.handlePlayButtonTouchEnd):
(ControllerIOS.prototype.handleBaseGestureStart):
(ControllerIOS.prototype.handleBaseGestureChange):
(ControllerIOS.prototype.handleBaseGestureEnd):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165919 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rebaseline bindings tests.

* bindings/scripts/test/JS/*:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash with long selector list
https://bugs.webkit.org/show_bug.cgi?id=123006

Reviewed by Andreas Kling.

Source/WebCore: 

Test: fast/css/long-selector-list-crash.html

* css/CSSSelectorList.cpp:
(WebCore::CSSSelectorList::CSSSelectorList):
(WebCore::CSSSelectorList::adoptSelectorVector):
(WebCore::CSSSelectorList::operator=):
* css/StyleRule.cpp:
(WebCore::StyleRule::create):

    Add a bunch of asserts.

(WebCore::StyleRule::splitIntoMultipleRulesWithMaximumSelectorComponentCount):
        
    This could produce a zero-length selector list.

LayoutTests: 

* fast/css/long-selector-list-crash-expected.txt: Added.
* fast/css/long-selector-list-crash.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165921 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Get rid of WKProcessClass
https://bugs.webkit.org/show_bug.cgi?id=130478

Reviewed by Dan Bernstein.

* UIProcess/API/Cocoa/WKProcessClass.h: Removed.
* UIProcess/API/Cocoa/WKProcessClass.mm: Removed.
* UIProcess/API/Cocoa/WKProcessClassConfiguration.h: Removed.
* UIProcess/API/Cocoa/WKProcessClassConfiguration.mm: Removed.
* UIProcess/API/Cocoa/WKProcessClassConfigurationPrivate.h: Removed.
* UIProcess/API/Cocoa/WKProcessClassPrivate.h: Removed.
* UIProcess/API/Cocoa/WKWebViewConfigurationToBeRemoved.mm: Removed.
* WebKit2.xcodeproj/project.pbxproj:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165922 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Attempt to fix the Production build.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165923 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS][WebKit2] <rdar://problem/16330387> Do not use the keyboard rect for computing the general unobscuredRect, only use it for centering
https://bugs.webkit.org/show_bug.cgi?id=130382

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-03-19
Reviewed by Simon Fraser.

Always accumulating the keyboard rect out of the exposedRect caused some issues (see <rdar://problem/16330387>).
This patch split the rect in two: unobscured rect for WebCore, and unobscuredContentRectIncludingKeyboard for centering
UI Elements in view.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _zoomToRect:WebCore::atScale:origin:WebCore::]):
(-[WKWebView _scrollToRect:WebCore::origin:WebCore::minimumScrollDistance:]):
(-[WKWebView _zoomToRect:WebCore::withOrigin:WebCore::fitEntireRect:minimumScale:maximumScale:minimumScrollDistance:]):
(-[WKWebView _contentRectForUserInteraction]):
(-[WKWebView _updateVisibleContentRects]):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165924 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS][WK2] Reduce the extended background's opacity when WKContentView is smaller than its WKWebView
https://bugs.webkit.org/show_bug.cgi?id=130436

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-03-19
Reviewed by Beth Dakin.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _updateScrollViewBackground]):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165925 268f45cc-cd09-0410-ab3c-d52691b4dbfc
GC timer should intelligently choose between EdenCollections and FullCollections
https://bugs.webkit.org/show_bug.cgi?id=128261

Reviewed by Geoffrey Garen.

Source/JavaScriptCore: 

Most of the GCs while browsing the web are due to the GC timer. Currently the GC timer 
always does FullCollections. To reduce the impact of the GC timer on the system this patch
changes Heap so that it has two timers, one for each type of collection. The FullCollection
timer is notified at the end of EdenCollections how much the Heap has grown since the last 
FullCollection and when somebody notifies the Heap of abandoned memory (which wouldn't be 
detected by an EdenCollection).

* heap/GCActivityCallback.cpp:
(JSC::GCActivityCallback::GCActivityCallback):
(JSC::GCActivityCallback::doWork):
(JSC::FullGCActivityCallback::FullGCActivityCallback):
(JSC::FullGCActivityCallback::doCollection):
(JSC::EdenGCActivityCallback::EdenGCActivityCallback):
(JSC::EdenGCActivityCallback::doCollection):
(JSC::GCActivityCallback::scheduleTimer):
(JSC::GCActivityCallback::cancelTimer):
(JSC::GCActivityCallback::didAllocate):
(JSC::GCActivityCallback::willCollect):
(JSC::GCActivityCallback::cancel):
* heap/GCActivityCallback.h:
(JSC::GCActivityCallback::GCActivityCallback):
(JSC::GCActivityCallback::createFullTimer):
(JSC::GCActivityCallback::createEdenTimer):
* heap/Heap.cpp:
(JSC::Heap::Heap):
(JSC::Heap::didAbandon):
(JSC::Heap::willStartCollection):
(JSC::Heap::updateAllocationLimits):
(JSC::Heap::setFullActivityCallback):
(JSC::Heap::setEdenActivityCallback):
(JSC::Heap::fullActivityCallback):
(JSC::Heap::edenActivityCallback):
(JSC::Heap::setGarbageCollectionTimerEnabled):
(JSC::Heap::didAllocate):
* heap/Heap.h:
* heap/HeapTimer.cpp:
(JSC::HeapTimer::timerDidFire):

Source/WebCore: 

No new tests.

* platform/ios/WebSafeGCActivityCallbackIOS.h: Update WebSafeGCActivityCallback
appropriately for the introduction of another type of GCActivityCallback.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165926 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement isPointInPath and isPointInStroke with Path2D argument
https://bugs.webkit.org/show_bug.cgi?id=130473

Reviewed by Dean Jackson.

Source/WebCore:

Implement isPointInPath and isPointInStroke for 2D Canvas contxts
with Path2D argument.

Tests: fast/canvas/canvas-path-isPointInPath.html
       fast/canvas/canvas-path-isPointInStroke.html

* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::isPointInPath):
(WebCore::CanvasRenderingContext2D::isPointInStroke):
(WebCore::CanvasRenderingContext2D::isPointInPathInternal):
(WebCore::CanvasRenderingContext2D::isPointInStrokeInternal):
* html/canvas/CanvasRenderingContext2D.h:
* html/canvas/CanvasRenderingContext2D.idl:

LayoutTests:

Test isPointInPath and isPointInStroke with Path2D argument.

* fast/canvas/canvas-path-isPointInPath-expected.txt: Added.
* fast/canvas/canvas-path-isPointInPath.html: Added.
* fast/canvas/canvas-path-isPointInStroke-expected.txt: Added.
* fast/canvas/canvas-path-isPointInStroke.html: Added.
* fast/canvas/script-tests/canvas-path-isPointInPath.js: Added.
* fast/canvas/script-tests/canvas-path-isPointInStroke.js: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165927 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Allow media engine to update HTMLMediaElement state when playing to external device
https://bugs.webkit.org/show_bug.cgi?id=130480

Reviewed by Jer Noble.

* html/HTMLMediaElement.h: Add mediaPlayerHandlePlaybackCommand.

* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::handlePlaybackCommand): New.
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerHandlePlaybackCommand):

* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::rateChanged): Send Play and Pause commands when
    playing to an external device.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165928 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Build fix for iOS after r165926

* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::commonVM):
* platform/ios/WebSafeGCActivityCallbackIOS.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165929 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Expose text and page zoom in WK2 SPI, and hook them up in MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=130476

Source/WebKit2:

Reviewed by Anders Carlsson.

Expose page and text zoom as SPI.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _supportsTextZoom]):
(-[WKWebView _textZoomFactor]):
(-[WKWebView _setTextZoomFactor:]):
(-[WKWebView _pageZoomFactor]):
(-[WKWebView _setPageZoomFactor:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:

Tools:

Reviewed by Anders Carlsson.

Hook up page/text zoom in MiniBrowser, make reload work, remove some logging.

* MiniBrowser/mac/WK1BrowserWindowController.m:
(-[WK1BrowserWindowController webView:decidePolicyForNavigationAction:request:frame:decisionListener:]):
Remove log.
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController awakeFromNib]):
(-[WK2BrowserWindowController validateMenuItem:]):
(-[WK2BrowserWindowController reload:]):
Hook up reload.
(-[WK2BrowserWindowController toggleZoomMode:]):
(-[WK2BrowserWindowController resetZoom:]):
(-[WK2BrowserWindowController canResetZoom]):
(-[WK2BrowserWindowController currentZoomFactor]):
(-[WK2BrowserWindowController setCurrentZoomFactor:]):
(-[WK2BrowserWindowController canZoomIn]):
(-[WK2BrowserWindowController canZoomOut]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165930 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Get rid of two IPC::Connection functions by folding them into lambdas
https://bugs.webkit.org/show_bug.cgi?id=130482

Reviewed by Tim Horton.

* Platform/IPC/Connection.cpp:
(IPC::Connection::addWorkQueueMessageReceiver):
(IPC::Connection::removeWorkQueueMessageReceiver):
* Platform/IPC/Connection.h:


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