[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
Added a missing @result to WKPreferences headerdoc
https://bugs.webkit.org/show_bug.cgi?id=133381

Reviewed by Dan Bernstein.

* UIProcess/API/Cocoa/WKPreferences.h:


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

Not reviewed.

* TestExpectations:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169459 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cocoa] Can’t recover from subframe load errors
https://bugs.webkit.org/show_bug.cgi?id=133385

Reviewed by Anders Carlsson.

* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declared new delegate method.
* UIProcess/Cocoa/NavigationState.h: Added flag in m_navigationDelegateMethods struct.
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate): Initialize
webViewNavigationDidFailProvisionalLoadInSubframeWithError flag in the delegate methods
struct.
(WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame): If the
error occurred in a subframe, invoke the new delegate method.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169460 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Add a WebKit2 Performance bot.
https://bugs.webkit.org/show_bug.cgi?id=132862

Patch by Carlos Alberto Lopez Perez <clopez@igalia.com> on 2014-05-29
Reviewed by Csaba Osztrogonác.

This adds a GTK WebKit2 perf bot.

* BuildSlaveSupport/build.webkit.org-config/config.json:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169461 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix an exception in InspectorBackend.Command.prototype.supports.

https://bugs.webkit.org/show_bug.cgi?id=133384

Reviewed by Joseph Pecoraro.

* UserInterface/Protocol/InspectorBackend.js:
(InspectorBackend.Command.prototype.supports): Use some not any.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169462 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Roll out r169439. <rdar://problem/17069364>

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169465 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Need to notify the keyboard about every KeyDown event.
https://bugs.webkit.org/show_bug.cgi?id=133383
<rdar://problem/16633975>

Reviewed by Benjamin Poulain.
        
A key down will generate most of the time a call to the keyboard to add input or delete.
But the event could be handled by JavaScript and its default prevented.
We need to notify the keyboard in every case to allow updating its internal state about what has been typed.

* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::doneWithKeyEvent):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _didHandleKeyEvent:]):



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