Add Obj-C API for cache partitioned URL schemes
https://bugs.webkit.org/show_bug.cgi?id=133361
<rdar://problem/17035415>

Reviewed by Anders Carlsson.

* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _initWithConfiguration:]):
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration cachePartitionedURLSchemes]):
(-[_WKProcessPoolConfiguration setCachePartitionedURLSchemes:]):
(-[_WKProcessPoolConfiguration copyWithZone:]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169437 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Whoops, update bindings tests results.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169438 268f45cc-cd09-0410-ab3c-d52691b4dbfc
viewStateDidChange should always fully update ViewState
https://bugs.webkit.org/show_bug.cgi?id=133159

Reviewed by Anders Carlson.

Currently WebPageProxy::viewStateDidChange is passed a mask of bits to update.

This has the following negative consequences:
 – WKWebView implicitly requires more detailed knowledge of the internal implementation of the PageClient.
 – Updates may unnecessarily be split over multiple IPC messages.
 – In order to support partial updates we make multiple virtual function calls to PageClient, which then makes duplicate objc calls.

Better to just always update the entire ViewState.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView didMoveToWindow]):
    - removed argument to viewStateDidChange.
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::viewState):
(WebKit::PageClientImpl::isViewWindowActive): Deleted.
(WebKit::PageClientImpl::isViewFocused): Deleted.
(WebKit::PageClientImpl::isViewVisible): Deleted.
(WebKit::PageClientImpl::isViewInWindow): Deleted.
* UIProcess/API/gtk/PageClientImpl.h:
    - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState.
* UIProcess/API/mac/WKView.mm:
(-[WKView becomeFirstResponder]):
(-[WKView resignFirstResponder]):
(-[WKView viewDidMoveToWindow]):
(-[WKView _windowDidBecomeKey:]):
(-[WKView _windowDidResignKey:]):
(-[WKView _windowDidMiniaturize:]):
(-[WKView _windowDidDeminiaturize:]):
(-[WKView _windowDidOrderOffScreen:]):
(-[WKView _windowDidOrderOnScreen:]):
(-[WKView _windowDidChangeOcclusionState:]):
(-[WKView viewDidHide]):
(-[WKView viewDidUnhide]):
(-[WKView _activeSpaceDidChange:]):
(-[WKView _setThumbnailView:]):
(-[WKView endDeferringViewInWindowChanges]):
(-[WKView endDeferringViewInWindowChangesSync]):
    - removed argument to viewStateDidChange.
* UIProcess/CoordinatedGraphics/WebView.cpp:
(WebKit::WebView::viewState):
(WebKit::WebView::isViewWindowActive): Deleted.
(WebKit::WebView::isViewFocused): Deleted.
(WebKit::WebView::isViewVisible): Deleted.
(WebKit::WebView::isViewInWindow): Deleted.
* UIProcess/CoordinatedGraphics/WebView.h:
    - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState.
* UIProcess/PageClient.h:
(WebKit::PageClient::isViewVisibleOrOccluded): Deleted.
(WebKit::PageClient::isVisuallyIdle): Deleted.
    - merged isViewVisibleOrOccluded/isVisuallyIdle to subclass viewState methods.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::reattachToWebProcess):
    - updateViewState -> PageClient::viewState
(WebKit::WebPageProxy::viewStateDidChange):
    - argument removed; updateViewState -> PageClient::viewState.
(WebKit::WebPageProxy::setCursor):
    - call isViewWindowActive on WebPageProxy, rather than PageClient.
(WebKit::WebPageProxy::updateBackingStoreDiscardableState):
    - call isViewWindowActive on WebPageProxy, rather than PageClient.
(WebKit::WebPageProxy::updateViewState): Deleted.
    - removed - viewState method moved to PageClient.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::isViewWindowActive):
    - added missing implementation.
(WebKit::WebPageProxy::isViewVisible):
    - removed argument to viewStateDidChange.
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::windowServerConnectionStateChanged):
    - removed argument to viewStateDidChange.
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::viewState):
(WebKit::PageClientImpl::isViewWindowActive): Deleted.
(WebKit::PageClientImpl::isViewFocused): Deleted.
(WebKit::PageClientImpl::isViewVisible): Deleted.
(WebKit::PageClientImpl::isViewInWindow): Deleted.
(WebKit::PageClientImpl::isViewVisibleOrOccluded): Deleted.
(WebKit::PageClientImpl::isVisuallyIdle): Deleted.
    - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState.
* UIProcess/ios/WKContentView.mm:
(-[WKContentView didMoveToWindow]):
(-[WKContentView _applicationDidEnterBackground:]):
(-[WKContentView _applicationWillEnterForeground:]):
    - removed argument to viewStateDidChange.
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::viewState):
(WebKit::PageClientImpl::showCorrectionPanel):
(WebKit::PageClientImpl::showDictationAlternativeUI):
(WebKit::PageClientImpl::isViewWindowActive): Deleted.
(WebKit::PageClientImpl::isViewFocused): Deleted.
(WebKit::PageClientImpl::isViewVisibleOrOccluded): Deleted.
(WebKit::PageClientImpl::isVisuallyIdle): Deleted.
    - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169439 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Captions during HLS playback flash/are difficult to readily
https://bugs.webkit.org/show_bug.cgi?id=133365
<rdar://problem/16584132>

Reviewed by Eric Carlson.

Correct two problems:
1. Add new logic to handle cues that are identical to existing cues, except
   that they cover a slightly later moment in playback. For example, a cue
   encoding device might emit a cue at 24 fps, with many of the cues containing
   the same content but covering only 1/24th of a second.
           
   Rather than hiding and displaying our cues at the cue encoding rate, we should
   simply continue to display the same cue as long as the content is unchanged.
2. The cue "isEqual" logic for TextTrackCueGeneric improperly short-circuited the
   VTTCue isEqual logic. This was done to avoid a false failure due to the cue
   type being 'generic' rather than 'vtt', but incorrectly treated cues with
   non-matching text as equal.

* html/track/DataCue.cpp:
(WebCore::DataCue::cueContentsMatch): Move cue comparison code to new method that
doesn't check that the 'type' of the cue is identical.
(WebCore::DataCue::isEqual): Modified to use new 'cueContentsMatch' method.
(WebCore::DataCue::isStartOfCue): Confirms cues match except for start and end times.
* html/track/DataCue.h:
* html/track/TextTrack.cpp:
(WebCore::TextTrack::hasCue): Modify to check if a new cue is simply a continuation
of an existing cue.
* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCue::cueContentsMatch): New method containing the equality code
that used to live in 'isEqual'.
(WebCore::TextTrackCue::isEqual): Modified to use new 'cueContentsMatch' method.
(WebCore::TextTrackCue::isStartOfCue): Confirms cues match except for start and
end times.
* html/track/TextTrackCue.h:
* html/track/TextTrackCueGeneric.cpp:
(WebCore::TextTrackCueGeneric::cueContentsMatch): New method containing the equality
code that used to live in 'isEqual'.
(WebCore::TextTrackCueGeneric::isEqual): Modified to use new 'cueContentsMatch' method.
(WebCore::TextTrackCueGeneric::isStartOfCue): Confirms cues match except for start and
end times.
* html/track/TextTrackCueGeneric.h:
* html/track/VTTCue.cpp:
(WebCore::VTTCue::cueContentsMatch): New method containing the equality code that
used to live in 'isEqual'.
(WebCore::VTTCue::isEqual): Modified to use new 'cueContentsMatch' method.
(WebCore::VTTCue::isStartOfCue): Confirms cues match except for start and end times.
* html/track/VTTCue.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169440 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Update my email addresses in contributors.json.

* Scripts/webkitpy/common/config/contributors.json:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169441 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2][GTK] ASSERTION FAILED: m_status == Scheduled in GMainLoopSource
https://bugs.webkit.org/show_bug.cgi?id=131220

Reviewed by Philippe Normand.

Unskip inspector-protocol/dom/remove-multiple-nodes.html.

* platform/gtk/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169443 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Use GMainLoopSource for idle and timeout sources in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=130081

Reviewed by Martin Robinson.

* Platform/WorkQueue.h:
* Platform/gtk/WorkQueueGtk.cpp:
(WorkQueue::registerSocketEventHandler): Stop pretending it's
possible to register a socket event handler for more than one
descriptor.
(WorkQueue::unregisterSocketEventHandler):
(WorkQueue::dispatch):
(WorkQueue::dispatchAfter):
* Shared/Downloads/soup/DownloadSoup.cpp:
(WebKit::DownloadClient::DownloadClient):
(WebKit::DownloadClient::~DownloadClient):
(WebKit::DownloadClient::didReceiveData):
(WebKit::DownloadClient::handleResponse):
(WebKit::DownloadClient::handleResponseLater):
* UIProcess/Plugins/gtk/PluginInfoCache.cpp:
(WebKit::PluginInfoCache::PluginInfoCache):
(WebKit::PluginInfoCache::~PluginInfoCache):
(WebKit::PluginInfoCache::saveToFile):
(WebKit::PluginInfoCache::updatePluginInfo):
* UIProcess/Plugins/gtk/PluginInfoCache.h:
* WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
(WebKit::LayerTreeHostGtk::LayerTreeHostGtk):
(WebKit::LayerTreeHostGtk::layerFlushTimerFired):
(WebKit::LayerTreeHostGtk::scheduleLayerFlush):
(WebKit::LayerTreeHostGtk::cancelPendingLayerFlush):
* WebProcess/WebPage/gtk/LayerTreeHostGtk.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Add HighDPI support for non-accelerated compositing contents
https://bugs.webkit.org/show_bug.cgi?id=131562

Patch by Owen Taylor <otaylor@redhat.com> on 2014-05-29
Reviewed by Anders Carlsson.

Source/WebCore:
No new tests. This will be tested once we have the proper dependencies in the WebKit testing
JHBuild.

* platform/cairo/WidgetBackingStore.h:
(WebCore::WidgetBackingStore::WidgetBackingStore): Accept a device scale argument.
* platform/cairo/WidgetBackingStoreCairo.cpp: Use the device scale argument to make the surface the proper size and set the surface device scale.
* platform/cairo/WidgetBackingStoreCairo.h: Accept a device scale argument.
* platform/graphics/cairo/CairoUtilities.cpp: Add a new helper to set the device scale if Cairo built against is new enough.
* platform/graphics/cairo/CairoUtilities.h:
* platform/gtk/GtkVersioning.h: Add the HAVE_GTK_SCALE_FACTOR macro.
* platform/gtk/WidgetBackingStoreGtkX11.cpp: Use the device scale argument to make the surface the proper size and set the surface device scale.
* platform/gtk/WidgetBackingStoreGtkX11.h: Accept a device scale argument.

Source/WebKit2:
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(deviceScaleFactorChanged): Added this callback to pass scale changes to the page proxy.
(webkitWebViewBaseCreateWebPage): Attach the callback to the notify signal.
* UIProcess/WebPageProxy.cpp:
* UIProcess/cairo/BackingStoreCairo.cpp:
(WebKit::WebPageProxy::setCustomDeviceScaleFactor): Do not set a
custom device scale factor for cairo when it's not supported.
(WebKit::createBackingStoreForGTK): Pass the scale factor to the WebCore backing store.
(WebKit::BackingStore::incorporateUpdate): Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169445 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Add support for HiDPI icons
https://bugs.webkit.org/show_bug.cgi?id=133377

Reviewed by Martin Robinson.

Source/WebCore:
Use the GTK+ missing icon at 16 or 32 size depending on the device
scale factor.

* platform/graphics/gtk/ImageGtk.cpp:
(WebCore::loadMissingImageIconFromTheme):
(WebCore::Image::loadPlatformResource):

Source/WebKit2:
* PlatformGTK.cmake: Compile also the @2x versions for the builtin icons.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169446 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DFG::DCEPhase inserts into an insertion set in reverse, causing hilarious basic block corruption if you kill a lot of NewArrays
https://bugs.webkit.org/show_bug.cgi?id=133368

Reviewed by Mark Lam.


Source/JavaScriptCore: 
* dfg/DFGDCEPhase.cpp:
(JSC::DFG::DCEPhase::fixupBlock): Loop in the right order so that we insert in the right order.
* tests/stress/new-array-dead.js: Added.
(foo):

Source/WTF: 
* wtf/Insertion.h:
(WTF::executeInsertions): This algorithm is only correct if insertions are added in the right order. Assert that the order is right.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169447 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a sandbox profile for com.apple.appstore.CodeRedeemerNetscapePlugin
https://bugs.webkit.org/show_bug.cgi?id=133360

Reviewed by Sam Weinig.

* Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb: Looks like
anyone using camera would need access to CoreMedia preferences.

* Resources/PlugInSandboxProfiles/com.apple.appstore.CodeRedeemerNetscapePlugin.sb: Added.

* WebKit2.xcodeproj/project.pbxproj: Added the profile.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169448 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use correct version of requiresFullscreenForVideoPlayback().
https://bugs.webkit.org/show_bug.cgi?id=133331

Patch by Jeremy Jones <jeremyj@apple.com> on 2014-05-29
Reviewed by Eric Carlson.

Source/WebCore:
Test: media/video-fullscreeen-only-controls.html

Update the last place not yet using m_mediaSession->requiresFullscreenForVideoPlayback.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):
switch to media session version for requriesFullscreenForVideoPlayback.

LayoutTests:
* media/video-fullscreeen-only-controls-expected.txt: Added.
* media/video-fullscreeen-only-controls.html: Added. Make sure video element
controls show even when not specified if inline playback is restricted.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169449 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Perserve caption selection in fullscreen.
https://bugs.webkit.org/show_bug.cgi?id=133350

Patch by Jeremy Jones <jeremyj@apple.com> on 2014-05-29
Reviewed by Eric Carlson.

Use the logic from the inline player to calculate the selected caption index.

* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::mediaControlsHost):
Expose mediaControlsHost() for use by WebVideoFullscreenModelMediaElement.

* platform/ios/WebVideoFullscreenModelMediaElement.mm:
(WebVideoFullscreenModelMediaElement::updateLegibleOptions):
Use logic from buildCaptionsMenu from mediaControlsApple.js.

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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169451 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WKBundleActivateMacFontAscentHack is unused
https://bugs.webkit.org/show_bug.cgi?id=133379

Reviewed by Anders Carlsson.

* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleActivateMacFontAscentHack): Deleted.
* WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.h:
* WebProcess/InjectedBundle/efl/InjectedBundleEfl.cpp:
(WebKit::InjectedBundle::activateMacFontAscentHack): Deleted.
* WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp:
(WebKit::InjectedBundle::activateMacFontAscentHack): Deleted.
* WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
(WebKit::InjectedBundle::activateMacFontAscentHack): Deleted.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169452 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fixed the WebKitTestRunner build after r169452.

* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::initialize):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169453 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Gardening: marking js/primitive-property-access-edge-cases.html as flaky.
<https://webkit.org/b/133356>

Not reviewed.

* TestExpectations:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169454 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (iOS WebKit2): Find-in-Page doesn't work in subframes
https://bugs.webkit.org/show_bug.cgi?id=133372
<rdar://problem/17045070>

Reviewed by Simon Fraser.

* WebProcess/WebPage/ios/FindControllerIOS.mm:
(WebKit::FindController::willFindString):
(WebKit::FindController::didFailToFindString):
(WebKit::FindController::didHideFindIndicator):
Flip ignoreCompositionSelectionChange and updateAppearanceEnabled on all
frames, not just the main frame, because the found string can be in a subframe.
Ideally we would flip it on/off for each frame as we move the selection between them,
but would require a lot of work (and the overhead of touching each frame shouldn't be significant).


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169455 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash loading skydrive.com (assertion under RemoteLayerTreeDisplayRefreshMonitor)
https://bugs.webkit.org/show_bug.cgi?id=133370
<rdar://problem/17061361>

Reviewed by Anders Carlsson.

* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::didUpdate):
Copy the set of refresh monitors so that we don't try to mutate the list we're iterating,
and don't try to fire refresh monitors that were removed in a previous iteration of the loop.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169456 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] Always use plug-in sandbox with sandboxed clients
https://bugs.webkit.org/show_bug.cgi?id=133358
<rdar://problem/15637695>

Reviewed by Anders Carlsson.

* PluginProcess/mac/PluginProcessMac.mm: (WebKit::PluginProcess::initializeSandbox):
Refuse to start if parent process is sandboxed, and plug-in process is not going to be.
None of this should run in normal case, because there are also checks on UI process side.
        
* Shared/Plugins/PluginModuleInfo.h:
* Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
(WebKit::NetscapePluginModule::getPluginInfo):
Added a member to PluginModuleInfo, telling whether the plug-in has a sandbox profile.

* Shared/Plugins/Netscape/mac/PluginInformationMac.mm:
(WebKit::getPlatformPluginModuleInformation): Use the new PluginModuleInfo member,
we no longer need to check the file system here.

* WebKit2.xcodeproj/project.pbxproj:
* Shared/mac/SandboxUtilities.h: Added.
* Shared/mac/SandboxUtilities.cpp: Added. (WebKit::processIsSandboxed):
This code is simple, but include magic is not. Moved it to a separate file to
avoid repeating.

* UIProcess/API/C/mac/WKContextPrivateMac.mm: Removed an unused include.

* UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
(WebKit::PluginInfoStore::shouldUsePlugin): Don't use unsandboxed plug-ins in
sandboxed applications.

* UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
(WebKit::PluginProcessProxy::platformGetLaunchOptions): Don't ever pass disable-sandbox
from sandboxed processes.

* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
(WebKit::XPCServiceInitializerDelegate::isClientSandboxed):
Use the new shared code in SandboxUtilities.h.



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