[Mac] Add support for VideoTrack to MediaPlayerPrivateAVFObjC
https://bugs.webkit.org/show_bug.cgi?id=122122

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/track/video-track.html

Refactor the methods which query AVAssetTrack and AVPlayerItemTrack into an Impl class, and
use that class to reset the properties of both AudioTrackAVFObjC and the new VideoTrackAVFObjC.

Add new files to project:
* WebCore.xcodeproj/project.pbxproj:

Add the new implementation class, shared by AudioTrackAVFObjC and VideoTrackAVFObjC:
* platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.h: Added.
(WebCore::AVTrackPrivateAVFObjCImpl::create): Simple factory.
(WebCore::AVTrackPrivateAVFObjCImpl::playerItemTrack): Simple getter.
* platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm: Added.
(WebCore::AVTrackPrivateAVFObjCImpl::AVTrackPrivateAVFObjCImpl): Simple constructor.
(WebCore::AVTrackPrivateAVFObjCImpl::enabled): Pass to AVPlayerItemTrack.
(WebCore::AVTrackPrivateAVFObjCImpl::setEnabled): Ditto.
(WebCore::AVTrackPrivateAVFObjCImpl::audioKind): Distinguish between Alternative and Main content.
(WebCore::AVTrackPrivateAVFObjCImpl::videoKind): Distinguish between Alternative, Main, Caption,
    and Description content.
(WebCore::AVTrackPrivateAVFObjCImpl::id): Pass to AVAssetTrack.
(WebCore::AVTrackPrivateAVFObjCImpl::label): Retrieve the Title metadata in the user's preferred
    language.
(WebCore::AVTrackPrivateAVFObjCImpl::language): Pass to languageForAVAssetTrack.
(WebCore::AVTrackPrivateAVFObjCImpl::languageForAVAssetTrack): Moved from AudioTrackPrivateAVFObjC.
* platform/graphics/avfoundation/VideoTrackPrivateAVF.h: Copied from Source/WebCore/platform/graphics/avfoundation/AudioTrackPrivateAVF.h.
(WebCore::VideoTrackPrivateAVF::kind): Simple getter.
(WebCore::VideoTrackPrivateAVF::id): Ditto.
(WebCore::VideoTrackPrivateAVF::label): Ditto.
(WebCore::VideoTrackPrivateAVF::language): Ditto.
(WebCore::VideoTrackPrivateAVF::setKind): Simple setter.
(WebCore::VideoTrackPrivateAVF::setId): Ditto.
(WebCore::VideoTrackPrivateAVF::setLabel): Ditto.
(WebCore::VideoTrackPrivateAVF::setLanguage): Ditto.
(WebCore::VideoTrackPrivateAVF::VideoTrackPrivateAVF): Simple constructor.
* platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.mm:
(WebCore::AudioTrackPrivateAVFObjC::AudioTrackPrivateAVFObjC): Create a AVTrackPrivateAVFObjCImpl.
(WebCore::AudioTrackPrivateAVFObjC::resetPropertiesFromTrack): Retrieve properties from m_impl.
(WebCore::AudioTrackPrivateAVFObjC::setPlayerItemTrack): Create a new AVTrackPrivateAVFObjCImpl.
(WebCore::AudioTrackPrivateAVFObjC::playerItemTrack): Pass to m_impl.
(WebCore::AudioTrackPrivateAVFObjC::setEnabled): Ditto.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): Refactor implementation into
    template method determineChangedTracksFromNewTracksAndOldItems().
(WebCore::determineChangedTracksFromNewTracksAndOldItems): Refactored.
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks): Pass to determineChangedTracksFromNewTracksAndOldItems.
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack): Changed class hosting
    languageForAVAssetTrack.
* platform/graphics/avfoundation/objc/VideoTrackPrivateAVFObjC.cpp: Added.
(WebCore::VideoTrackPrivateAVFObjC::VideoTrackPrivateAVFObjC): Create a AVTrackPrivateAVFObjCImpl.
(WebCore::VideoTrackPrivateAVFObjC::resetPropertiesFromTrack): Retrieve properties from m_impl.
(WebCore::VideoTrackPrivateAVFObjC::setPlayerItemTrack): Create a new AVTrackPrivateAVFObjCImpl.
(WebCore::VideoTrackPrivateAVFObjC::playerItemTrack): Pass to m_impl.
(WebCore::VideoTrackPrivateAVFObjC::setSelected): Ditto.
* platform/graphics/avfoundation/objc/VideoTrackPrivateAVFObjC.h: Added.
(WebCore::VideoTrackPrivateAVFObjC::create): Simple factory.

LayoutTests:

* media/track/video-track-expected.txt: Added.
* media/track/video-track.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156722 268f45cc-cd09-0410-ab3c-d52691b4dbfc
SpeculativeJIT::m_arguments/m_variables are vestiges of a time long gone
https://bugs.webkit.org/show_bug.cgi?id=122140

Reviewed by Darin Adler.
        
Just killing code.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::SpeculativeJIT):
(JSC::DFG::SpeculativeJIT::compileInlineStart):
(JSC::DFG::SpeculativeJIT::compileCurrentBlock):
(JSC::DFG::SpeculativeJIT::checkArgumentTypes):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::recordSetLocal):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156723 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[mac] 1x emulation on Retina hardware shouldn't use SPI
https://bugs.webkit.org/show_bug.cgi?id=122152
<rdar://problem/15119384>

Reviewed by Anders Carlsson.

* DumpRenderTree/mac/DumpRenderTree.mm:
(createWebViewAndOffscreenWindow):
(main):
* DumpRenderTree/mac/DumpRenderTreeWindow.h:
* DumpRenderTree/mac/DumpRenderTreeWindow.mm:
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::PlatformWebView):
* WebKitTestRunner/mac/main.mm:
(main):
Register for AppleMagnifiedMode instead of using _setWindowResolution:displayIfChanged:.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156724 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[wk2] WebKitTestRunner's window snapshots are blank with tiled drawing
https://bugs.webkit.org/show_bug.cgi?id=122006
<rdar://problem/15095197>

Reviewed by Dean Jackson.

* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::PlatformWebView):
Layer-back the root view in WebKitTestRunner's window, to work around a bug
where the window server snapshot API returns blank snapshots.

Re-landing after r156724, this should not break everything now.

Add a test that ensures that WebKitTestRunner's snapshots are not
completely blank with tiled drawing enabled.

* platform/mac-wk2/tiled-drawing/window-server-snapshots-work-expected-mismatch.html: Added.
* platform/mac-wk2/tiled-drawing/window-server-snapshots-work.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156725 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix; The addedFunction and removedFunction arguments to determineChangedTracksFromNewTracksAndOldItems
were reversed, exposing an underlying, existing bug in AudioTrackPrivate and VideoTrack private. Give a default (null)
value to AudioTrackPrivate::m_client and VideoTrackPrivate::m_client and fix the ordering of arguments in
determineChangedTracksFromNewTracksAndOldItems.

* platform/graphics/AudioTrackPrivate.h:
(WebCore::AudioTrackPrivate::AudioTrackPrivate):
* platform/graphics/VideoTrackPrivate.h:
(WebCore::VideoTrackPrivate::VideoTrackPrivate):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::determineChangedTracksFromNewTracksAndOldItems):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156726 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Console buttons don’t show after page reload
https://bugs.webkit.org/show_bug.cgi?id=116515

Reviewed by Darin Adler.

The correct display of navigation items in the ContentBrowser is contingent on
the ContentViewContainer's _backForwardList being up-to-date when the navigation
items are retrieved from it. However, when the main resource changes (in this case
the user refreshes the browser), calls are made to ContentViewContainer's
closeAllContentViewsOfPrototype() which may modify the _backForwardList but doesn't
necessarily notify of a change to the currentContentView since we may be still showing
the same view in case it wasn't directly related to the main resource, for instance
the console log.

We now check if the _backForwardList is changed as a result of calling
closeAllContentViewsOfPrototype() and in that case also dispatch the
CurrentContentViewDidChange event which will restore the correct state
for the back/forward buttons and navigation items of the navigation bar.

* UserInterface/ContentViewContainer.js:
(WebInspector.ContentViewContainer.prototype.closeAllContentViewsOfPrototype):
Track changes to the _backForwardList and dispatch the CurrentContentViewDidChange
event in case such changes happened.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156727 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: evaluate and show a popover for selected text in JS source when paused
https://bugs.webkit.org/show_bug.cgi?id=122151

Reviewed by Joseph Pecoraro.

Identify if the hovered token is contained within the text selection (if any) and use
the selection as the hovered expression to allow the user to select text and hover it
to see what it evaluates to.

* UserInterface/CodeMirrorTokenTrackingController.js:
(WebInspector.CodeMirrorTokenTrackingController.prototype.highlightRange):
Check we're trying to highlight a different range before removing the highlight
and applying the new one, this prevents the marked text from flashing if it's
being re-hovered which would easily happen when hovering multiple tokens within
the same selection.

(WebInspector.CodeMirrorTokenTrackingController.prototype._processJavaScriptExpression):
In the case where there is selected text, check whether the hovered token is at least
partially contained within the selection, and if so use the selection text as the
hovered expression to evaluate.


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