[Win] Gracefully recover from missing 'naturalSize' parameter for media
https://bugs.webkit.org/show_bug.cgi?id=129278

Reviewed by Eric Carlson.

* platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h: Add declaration for
missing function call.
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::assetStatus): Don't treat missing 'naturalSize'
as a fatal error.
(WebCore::MediaPlayerPrivateAVFoundationCF::tracksChanged): Handle case of asset track
not being available yet. 
(WebCore::MediaPlayerPrivateAVFoundationCF::sizeChanged): If the 'naturalSize' is empty,
use the Player Item's 'presentationSize' instead.
(WebCore::AVFWrapper::processNotification): Add missing handler for duration changed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164660 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Show status image when playing video to external device
https://bugs.webkit.org/show_bug.cgi?id=129277

Reviewed by Jer Noble.

* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.handleEvent): Restructure the code so it is possible to handle events
    that target the video element which aren't in the HandledVideoEvents array.

* Modules/mediacontrols/mediaControlsiOS.js:
(ControllerIOS.prototype.currentPlaybackTargetIsWireless): webkitCurrentPlaybackTargetIsWireless
    is an attribute, not a function.
(ControllerIOS.prototype.updateWirelessPlaybackStatus): Fix style.
(ControllerIOS.prototype.updateWirelessTargetAvailable): Ditto.
(ControllerIOS.prototype.updateProgress): Ditto.
(ControllerIOS.prototype.handleWrapperTouchStart): Show the controls if the wireless status
    display is touched.
(ControllerIOS.prototype.handleFullscreenButtonClicked): Fix style
(ControllerIOS.prototype.handleWirelessPlaybackChange): Ditto.
(ControllerIOS.prototype.handleWirelessTargetAvailableChange):
(ControllerIOS.prototype.handleWirelessPickerButtonClicked): Ditto. Stop even propagation.

Move "playback target" logic into HTMLMediaSession.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::~HTMLMediaElement): Call media session.
(WebCore::HTMLMediaElement::loadResource): Tell media session to apply media player
    restrictions now that it has a url.
(WebCore::HTMLMediaElement::invalidateCachedTime): Only log when cached time is not
    already invalie.
(WebCore::HTMLMediaElement::webkitShowPlaybackTargetPicker): Call media session.
(WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless): Ditto.
(WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged): Ditto.
(WebCore::HTMLMediaElement::addEventListener): Ditto.
(WebCore::HTMLMediaElement::removeEventListen): Ditto.
(WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent): Ditto.
(WebCore::HTMLMediaElement::createMediaPlayer): Ditto.

* html/HTMLMediaSession.cpp:
(WebCore::restrictionName): Log new WirelessVideoPlaybackDisabled restriction.
(WebCore::HTMLMediaSession::showingPlaybackTargetPickerPermitted): Return false if there
    is no page, or if wireless playback is disabled.
(WebCore::HTMLMediaSession::currentPlaybackTargetIsWireless): New, logic from HTMLMediaElement.
(WebCore::HTMLMediaSession::showPlaybackTargetPicker): Ditto.
(WebCore::HTMLMediaSession::hasWirelessPlaybackTargets): Ditto.
(WebCore::HTMLMediaSession::wirelessVideoPlaybackDisabled): Ditto.
(WebCore::HTMLMediaSession::setWirelessVideoPlaybackDisabled): Ditto.
(WebCore::HTMLMediaSession::setHasPlaybackTargetAvailabilityListeners): Ditto.
(WebCore::HTMLMediaSession::applyMediaPlayerRestrictions): New, apply media player specific
    restriction.
* html/HTMLMediaSession.h:

Move "playback target" logic into HTMLMediaSession.
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::parseAttribute): Call media session.
(WebCore::HTMLVideoElement::webkitWirelessVideoPlaybackDisabled): Call media session.

* platform/audio/MediaSessionManager.h:
(WebCore::MediaSessionManager::showPlaybackTargetPicker): New method, does nothing in base class.

* platform/audio/ios/MediaSessionManagerIOS.h:
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::showPlaybackTargetPicker): Add non-functional stub.

Implement wireless playback control and status API.
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification): Dispatch TargetIsWirelessChanged.
(WebCore::MediaPlayerPrivateAVFoundation::playbackTargetIsWirelessChanged): Pass through to
    media element.
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): Initialize
    m_allowsWirelessVideoPlayback.
(WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad): Remove "externalPlaybackActive" observer.
(WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer): Fix broken logging.
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): Add "externalPlaybackActive" observer,
    set initial wireless playback.
(WebCore::MediaPlayerPrivateAVFoundationObjC::createPixelBuffer):  Fix broken logging.
(WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless): New.
(WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessVideoPlaybackDisabled): New.
(WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessVideoPlaybackDisabled): New.
(WebCore::MediaPlayerPrivateAVFoundationObjC::playbackTargetIsWirelessDidChange): New.
(-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): Deal with
    externalPlaybackActive.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164661 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r164638.
http://trac.webkit.org/changeset/164638
https://bugs.webkit.org/show_bug.cgi?id=129321

Broke Windows build. (Requested by bfulgham on #webkit).

* dom/ContainerNode.h:
(WebCore::ChildNodesLazySnapshot::takeSnapshot):
(WebCore::ChildNodesLazySnapshot::hasSnapshot):
* dom/Element.cpp:
(WebCore::ensureAttrNodeListForElement):
(WebCore::Element::attributes):
* dom/ElementIteratorAssertions.h:
(WebCore::ElementIteratorAssertions::ElementIteratorAssertions):
* dom/ElementRareData.h:
(WebCore::ElementRareData::create):
(WebCore::ElementRareData::setAttributeMap):
* dom/MutationObserverRegistration.cpp:
(WebCore::MutationObserverRegistration::create):
(WebCore::MutationObserverRegistration::observedSubtreeNodeWillDetach):
(WebCore::MutationObserverRegistration::clearTransientRegistrations):
(WebCore::MutationObserverRegistration::addRegistrationNodesToSet):
* dom/MutationObserverRegistration.h:
* dom/NamedNodeMap.h:
(WebCore::NamedNodeMap::create):
(WebCore::NamedNodeMap::NamedNodeMap):
* dom/Node.cpp:
(WebCore::Node::ensureRareData):
(WebCore::Node::didMoveToNewDocument):
(WebCore::Node::ensureEventTargetData):
(WebCore::Node::mutationObserverRegistry):
(WebCore::Node::registerMutationObserver):
(WebCore::Node::unregisterMutationObserver):
(WebCore::Node::notifyMutationObserversNodeWillDetach):
* dom/Node.h:
* dom/NodeRareData.h:
(WebCore::NodeListsNodeData::create):
(WebCore::NodeListsNodeData::NodeListsNodeData):
(WebCore::NodeMutationObserverData::create):
(WebCore::NodeMutationObserverData::NodeMutationObserverData):
(WebCore::NodeRareData::create):
(WebCore::NodeRareData::clearNodeLists):
(WebCore::NodeRareData::ensureNodeLists):
(WebCore::NodeRareData::ensureMutationObserverData):
(WebCore::NodeRareData::NodeRareData):
* dom/StyledElement.cpp:
(WebCore::StyledElement::rebuildPresentationAttributeStyle):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164662 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ARM64 rshift64 should be an arithmetic shift
https://bugs.webkit.org/show_bug.cgi?id=129323

Reviewed by Mark Hahnenberg.

* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::rshift64):



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

* CMakeLists.txt: Added WebVisitedLinkProvider.cpp.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164664 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DefaultVisitedLinkProvider can just call into the page group directly
https://bugs.webkit.org/show_bug.cgi?id=129320

Reviewed by Andreas Kling.

* page/DefaultVisitedLinkProvider.cpp:
(WebCore::DefaultVisitedLinkProvider::isLinkVisited):
(WebCore::DefaultVisitedLinkProvider::addVisitedLink):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164665 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cocoa] Add delegate method for customizing actions on activated elements
https://bugs.webkit.org/show_bug.cgi?id=129290

Reviewed by Anders Carlsson.

* UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Added. Declared new delegate method.

* UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
(_WKActivatedElementType): Defined enum of element types.
* UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
(-[_WKActivatedElementInfo _initWithType:URL:location:title:rect:]): Added type parameter
to the initializer, used to set the new type property.
* UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h:

* UIProcess/Cocoa/UIClient.h:
* UIProcess/Cocoa/UIClient.mm:
(WebKit::UIClient::setDelegate): Initialize webViewActionsForElementDefaultActions member
of m_delegateMethods.
(WebKit::UIClient::actionsForElement): Added. Calls out to the new delegate method if
implemented. Otherwise returns the default actions.

* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant actionSheet:clickedButtonAtIndex:]): Use new _elementInfo ivar
instead of creating element info here.
(-[WKActionSheetAssistant showImageSheet]): Create element info here and assign it to
_elementInfo ivar if presenting a sheet. Call the UI client to get custom actions.
(-[WKActionSheetAssistant showLinkSheet]): Ditto.
(-[WKActionSheetAssistant cleanupSheet]): Clear _elementInfo ivar.
* WebKit2.xcodeproj/project.pbxproj: Added reference to WKUIDelegatePrivate.h.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164666 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r164627.
http://trac.webkit.org/changeset/164627
https://bugs.webkit.org/show_bug.cgi?id=129325

Broke SubtleCrypto tests (Requested by ap on #webkit).

Source/JavaScriptCore:

* API/APIShims.h:
(JSC::APIEntryShim::APIEntryShim):
(JSC::APICallbackShim::shouldDropAllLocks):
* heap/MachineStackMarker.cpp:
(JSC::MachineThreads::addCurrentThread):
* runtime/JSLock.cpp:
(JSC::JSLockHolder::JSLockHolder):
(JSC::JSLockHolder::init):
(JSC::JSLockHolder::~JSLockHolder):
(JSC::JSLock::JSLock):
(JSC::JSLock::lock):
(JSC::JSLock::unlock):
(JSC::JSLock::currentThreadIsHoldingLock):
(JSC::JSLock::dropAllLocks):
(JSC::JSLock::grabAllLocks):
* runtime/JSLock.h:
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:
(JSC::VM::currentThreadIsHoldingAPILock):

Source/WebCore:

* bindings/js/JSDOMBinding.cpp:
(WebCore::reportException):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::commonVM):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164667 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION: All inspector-protocol/model very frequently assert in IDBRequest::~IDBRequest
https://bugs.webkit.org/show_bug.cgi?id=129328

inspector-protocol/indexeddb/basics.html fails
https://bugs.webkit.org/show_bug.cgi?id=129327

* TestExpectations: Updating test expectations.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164668 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rolling out http://trac.webkit.org/changeset/164611, because it broke
WebKit2.PrivateBrowsingPushStateNoHistoryCallback API test

The change was for:

Source/WebCore: 

https://bugs.webkit.org/show_bug.cgi?id=129141
Create SessionID class

Source/WebKit2: 

https://bugs.webkit.org/show_bug.cgi?id=129141
Create SessionID class



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

Reviewed by Dan Bernstein.

Source/WebCore:

* GNUmakefile.list.am:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* platform/PlatformStrategies.h:
(WebCore::PlatformStrategies::PlatformStrategies):
* platform/VisitedLinkStrategy.h: Removed.

Source/WebKit/efl:

* WebCoreSupport/PlatformStrategiesEfl.cpp:
(PlatformStrategiesEfl::getPluginInfo):
* WebCoreSupport/PlatformStrategiesEfl.h:

Source/WebKit/gtk:

* WebCoreSupport/PlatformStrategiesGtk.cpp:
(PlatformStrategiesGtk::getPluginInfo):
* WebCoreSupport/PlatformStrategiesGtk.h:

Source/WebKit/mac:

* WebCoreSupport/WebPlatformStrategies.h:
* WebCoreSupport/WebPlatformStrategies.mm:

Source/WebKit/win:

* WebCoreSupport/WebPlatformStrategies.cpp:
(WebPlatformStrategies::getPluginInfo):
* WebCoreSupport/WebPlatformStrategies.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164670 268f45cc-cd09-0410-ab3c-d52691b4dbfc
inspector-protocol/page/deny-X-FrameOption.html is very flaky
https://bugs.webkit.org/show_bug.cgi?id=129331

* TestExpectations: Marking as such.



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

Remove VisitedLinkStrategy.

* NetworkProcess/NetworkProcessPlatformStrategies.cpp:
* NetworkProcess/NetworkProcessPlatformStrategies.h:
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:

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