[Mac] Unreviewed gardening.

Unskip subpixel border tests.

* platform/mac/TestExpectations:
* platform/mac/css1/units/length_units-expected.txt:
* platform/mac/fast/css/bidi-override-in-anonymous-block-expected.txt:
* platform/mac/fast/repaint/repaint-during-scroll-with-zoom-expected.txt:
* platform/mac/ietestcenter/css3/bordersbackgrounds/border-radius-initial-value-001-expected.txt:
* platform/mac/ietestcenter/css3/bordersbackgrounds/border-radius-style-001-expected.txt:
* platform/mac/ietestcenter/css3/bordersbackgrounds/border-radius-style-002-expected.txt:
* platform/mac/ietestcenter/css3/bordersbackgrounds/border-radius-style-004-expected.txt:
* platform/mac/ietestcenter/css3/bordersbackgrounds/border-radius-with-three-values-001-expected.txt:
* platform/mac/ietestcenter/css3/bordersbackgrounds/border-radius-with-two-values-001-expected.txt:
* platform/mac/ietestcenter/css3/bordersbackgrounds/border-top-left-radius-values-003-expected.txt:
* platform/mac/media/video-zoom-expected.txt:
* platform/mac/svg/custom/svg-fonts-in-html-expected.txt:
* platform/mac/svg/zoom/page/zoom-svg-float-border-padding-expected.txt:
* platform/mac/tables/mozilla_expected_failures/bugs/bug1055-2-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174786 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crashes in ResourceHandleCFURLConnectionDelegateWithOperationQueue due to unimplemented retain/release
https://bugs.webkit.org/show_bug.cgi?id=137779
rdar://problem/18679320

Reviewed by Brady Eidson.

* platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegate::retain):
(WebCore::ResourceHandleCFURLConnectionDelegate::release):
(WebCore::ResourceHandleCFURLConnectionDelegate::makeConnectionClient):
* platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
Implemented retain/release. They are necessary, as ResourceHandle goes away when
it's canceled, and there is noone else to keep the client object alive but
CFURLConnection itself.

* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFail):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveChallenge):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didSendBodyData):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveDataArray):
Added a FIXME about potential improvements that I spotted while invsestigating this.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174787 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Various crashes in ViewGestureControllerIOS when closing a tab while a swipe gesture is in progress
https://bugs.webkit.org/show_bug.cgi?id=137770
<rdar://problem/17916459>

Reviewed by Dan Bernstein.

When tearing down a WKWebView in the middle of a swipe gesture, a variety of
UI process crashes were observed. First, two uses of potentially deleted objects
(the WebBackForwardListItem and ViewGestureController), which were fixed by
extending the object's lifetime and checking for its liveness, respectively.
Second, a potential null-deref of DrawingArea if the timing of endSwipeGesture
vs. page teardown was such that DrawingArea was null but everything else was in line.
Lastly, another case of messaging a potentially deleted object (specifically,
the _UIViewControllerTransitionContext's animator) in a callback from CA, which
was fixed by nulling out the animator (and a few other properties) when tearing
down the ViewGestureController.

* UIProcess/ios/ViewGestureControllerIOS.mm:
(-[WKSwipeTransitionController invalidate]):
Clear the soon-to-be-invalid ViewGestureController pointer.

(WebKit::ViewGestureController::~ViewGestureController):
Call [WKSwipeTransitionController invalidate] upon destruction.
Clear our transition context's interactor and animator, and inform it that
the transition is not in flight. This avoids a crash when calling back
to the already-destroyed animator later.

(WebKit::ViewGestureController::beginSwipeGesture):
Keep a reference to the target WebBackForwardListItem; this avoids
it being deleted between here and the transition completion block firing.

Look up the ViewGestureController by pageID, just like we do in endSwipeGesture,
to avoid situations where the callback fires after the WKWebView/ViewGestureController
have gone away.

Hold on to our _UIViewControllerOneToOneTransitionContext, so that we can do the
aforementioned clearing upon deallocation.

(WebKit::ViewGestureController::endSwipeGesture):
Null check the DrawingArea. If it is null, instead of doing our normal delayed logic
for swipe snapshot teardown, just put things back together immediately.

(WebKit::ViewGestureController::removeSwipeSnapshot):
Clear m_swipeTransitionContext.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Have the ProfileType node in the DFG convert to a structure check where it can
https://bugs.webkit.org/show_bug.cgi?id=137596

Reviewed by Filip Pizlo.

TypeSet now keeps track of the live set of Structures it has seen.
It no longer nukes everything during GC. It now only removes unmarked
structures during GC. This modification allows the ProfileType node
to convert into a CheckStructure node safely in the DFG.

This change brings up the conversion rate from ProfileType to Check
or CheckStructrue from ~45% to ~65%. This change also speeds the
type profiler up significantly: consistently between 2x-20x faster.

This patch also does some slight refactoring: a few type profiler
related fields are moved from VM to TypeProfiler.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::CodeBlock):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNode.h:
(JSC::DFG::Node::convertToCheckStructure):
* heap/Heap.cpp:
(JSC::Heap::collect):
* runtime/SymbolTable.cpp:
(JSC::SymbolTable::uniqueIDForVariable):
* runtime/SymbolTable.h:
* runtime/TypeLocationCache.cpp:
(JSC::TypeLocationCache::getTypeLocation):
* runtime/TypeProfiler.cpp:
(JSC::TypeProfiler::TypeProfiler):
(JSC::TypeProfiler::nextTypeLocation):
(JSC::TypeProfiler::invalidateTypeSetCache):
(JSC::TypeProfiler::dumpTypeProfilerData):
* runtime/TypeProfiler.h:
(JSC::TypeProfiler::getNextUniqueVariableID):
* runtime/TypeProfilerLog.cpp:
(JSC::TypeProfilerLog::processLogEntries):
* runtime/TypeSet.cpp:
(JSC::TypeSet::addTypeInformation):
(JSC::TypeSet::invalidateCache):
* runtime/TypeSet.h:
(JSC::TypeSet::structureSet):
* runtime/VM.cpp:
(JSC::VM::VM):
(JSC::VM::enableTypeProfiler):
(JSC::VM::disableTypeProfiler):
(JSC::VM::dumpTypeProfilerData):
(JSC::VM::nextTypeLocation): Deleted.
(JSC::VM::invalidateTypeSetCache): Deleted.
* runtime/VM.h:
(JSC::VM::typeProfiler):
(JSC::VM::getNextUniqueVariableID): Deleted.
* tests/typeProfiler/dfg-jit-optimizations.js:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174789 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Apparently we've had a hole in arguments capture all along
https://bugs.webkit.org/show_bug.cgi?id=137767

Reviewed by Oliver Hunt.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::getArgument):
* tests/stress/arguments-captured.js: Added.
(foo):
(bar):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174790 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement selection services menu for Legacy WebKit
https://bugs.webkit.org/show_bug.cgi?id=137582
<rdar://problem/18604241>

Reviewed by Brady Eidson.

* WebCore.exp.in:
* editing/Editor.h:
* editing/ios/EditorIOS.mm:
(WebCore::Editor::replaceSelectionWithAttributedString):
* editing/mac/EditorMac.mm:
(WebCore::Editor::replaceSelectionWithAttributedString):
Add replaceSelectionWithAttributedString, which replaces the selection
with the given attributed string (converting to plain text if the destination
is not richly editable).

* WebKit.xcodeproj/project.pbxproj:

* Misc/WebSharingServicePickerController.h:
Move SPI into the header (in the near future it will be moved to a modern-style SPI header).
Add WebSharingServicePickerClient, which other classes can implement
instead of tying WebSharingServicePickerController strongly to WebContextMenuClient.
Make initWithData:... -> initWithItems:... instead, taking an array of NSItemProviders.

* Misc/WebSharingServicePickerController.mm:
Pass in NSSharingServicePickerStyle, so that clients can specify the style.

(-[WebSharingServicePickerController clear]):
(-[WebSharingServicePickerController didShareImageData:confirmDataIsValidTIFFData:]):
(-[WebSharingServicePickerController sharingServicePicker:didChooseSharingService:]):
(-[WebSharingServicePickerController sharingService:sourceFrameOnScreenForShareItem:]):
(-[WebSharingServicePickerController sharingService:transitionImageForShareItem:contentRect:]):
(-[WebSharingServicePickerController sharingService:sourceWindowForShareItems:sharingContentScope:]):
Make use of WebSharingServicePickerClient.

(-[WebSharingServicePickerController sharingService:didShareItems:]):
If we're returned a NSAttributedString, paste it on top of the current selection,
similar to what the WebKit2 implementation currently does.

* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::handleTelephoneNumberClick):
(WebChromeClient::handleSelectionServiceClick):
(WebChromeClient::hasRelevantSelectionServices):
Override the services-related ChromeClient functions, forward them to WebSelectionServiceController.

* WebCoreSupport/WebContextMenuClient.h:
* WebCoreSupport/WebContextMenuClient.mm:
(WebContextMenuClient::sharingServicePickerWillBeDestroyed):
(WebContextMenuClient::pageForSharingServicePicker):
(WebContextMenuClient::windowForSharingServicePicker):
(WebContextMenuClient::screenRectForCurrentSharingServicePickerItem):
(WebContextMenuClient::imageForCurrentSharingServicePickerItem):
(WebContextMenuClient::contextMenuForEvent):
(WebContextMenuClient::screenRectForHitTestNode): Deleted.
(WebContextMenuClient::renderedImageForControlledImage): Deleted.
(WebContextMenuClient::clearSharingServicePickerController): Deleted.
Have WebContextMenuClient implement WebSharingServicePickerClient to avoid
having WebSharingServicePickerController tightly bound to it.
Make an NSItemProvider array when instantiating WebSharingServicePickerController
instead of handing it data directly.

* WebCoreSupport/WebSelectionServiceController.h: Copied from Source/WebKit/mac/WebCoreSupport/WebContextMenuClient.h.
* WebCoreSupport/WebSelectionServiceController.mm: Added.
(WebSelectionServiceController::WebSelectionServiceController):
Add WebSelectionServiceController, which will act as the WebSharingServicePickerClient
for selection services.

(WebSelectionServiceController::handleSelectionServiceClick):
Create a WebSharingSericePickerController with the selection's attributed string, and show its menu.

(hasCompatibleServicesForItems):
(WebSelectionServiceController::hasRelevantSelectionServices):
Determine whether or not services are available.

(WebSelectionServiceController::sharingServicePickerWillBeDestroyed):
(WebSelectionServiceController::pageForSharingServicePicker):
(WebSelectionServiceController::windowForSharingServicePicker):
Implement the rest of the WebSharingServicePickerClient overrides.

(WebSelectionServiceController::screenRectForCurrentSharingServicePickerItem):
(WebSelectionServiceController::imageForCurrentSharingServicePickerItem):
These are only useful for image sharing services, so we don't need to
implement them (WebContextMenuClient does, on the other hand).

* WebView/WebView.mm:
(-[WebView _selectionServiceController]):
* WebView/WebViewData.h:
* WebView/WebViewData.mm:
* WebView/WebViewInternal.h:
Keep a WebSelectionServiceController.

* UIProcess/mac/WebContextMenuProxyMac.mm:
(-[WKSharingServicePickerDelegate sharingService:didShareItems:]):
Add a note that we should transition to using replaceSelectionWithAttributedString.

* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::handleSelectionServiceClick):
Allow editor services in editable-but-not-rich-text areas, just like in WebKit1.


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