Allow the ChromeClient to provide a custom ScrollingCoordinator
https://bugs.webkit.org/show_bug.cgi?id=126450

Reviewed by Tim Horton.

Some platforms will want to provide a custom ScrollingCoordinator, so let
them do so by asking ChromeClient first for one.

* page/ChromeClient.h:
(WebCore::ChromeClient::createScrollingCoordinator):
* page/Page.cpp:
(WebCore::Page::scrollingCoordinator):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161279 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[MediaControls][iOS] Enable JavaScript Media Controls on iOS.
https://bugs.webkit.org/show_bug.cgi?id=126440

Reviewed by Eric Carlson.

Drive-by misspelling fix, and add a convenience function to check if the
controls are currently hidden:
* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.handleWrapperMouseMove):
(Controller.prototype.handleWrapperMouseOut):
(Controller.prototype.updatePlaying):
(Controller.prototype.controlsAreHidden): Added.

Add a new subclass of Controller for iOS and a matching CSS:
* Modules/mediacontrols/mediaControlsiOS.css: Added.
* Modules/mediacontrols/mediaControlsiOS.js: Added.
(createControls): Override the createControls() in mediaControlsApple.js.
(ControllerIOS): Define a new class.
(ControllerIOS.prototype.inheritFrom): Convenience method to mixin parent
    prototype methods.
(ControllerIOS.prototype.createBase): Override, listen for touches instead of mouse events.
(ControllerIOS.prototype.createControls): Ditto.
(ControllerIOS.prototype.configureInlineControls): Override, only add play, timeline, and full
    screen butttons.
(ControllerIOS.prototype.configureFullScreenControls): Override, and add no buttons.
(ControllerIOS.prototype.handlePlayButtonTouchStart): Activate.
(ControllerIOS.prototype.handlePlayButtonTouchEnd): De-activate and do action.
(ControllerIOS.prototype.handlePlayButtonTouchCancel): De-activate and cancel.
(ControllerIOS.prototype.handleWrapperTouchStart): Show controls.
(ControllerIOS.prototype.handlePanelTouchStart): Disable video selection.
(ControllerIOS.prototype.handlePanelTouchEnd): Re-enable video selection.
(ControllerIOS.prototype.handlePanelTouchCancel): Ditto.

Drive-by fix to enable the JavaScript controls when the plugin is disabled:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):

Add the iOS JavaScript by appending it to the generic (Apple) JavaScript:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::mediaControlsScript):

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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161280 268f45cc-cd09-0410-ab3c-d52691b4dbfc
It feels too hard to get rid of a popover at build.webkit.org/dashboard
https://bugs.webkit.org/show_bug.cgi?id=126451

Reviewed by Simon Fraser.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Styles/Popover.css:
(.popover.fade-out): Reduced the timeout - 200 ms is enough to not have flicker
when moving the mouse from an element to its popover.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161281 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Attempt to fix EFL build.

* CMakeLists.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161282 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Maybe fix Windows build.

* WebCore.vcxproj/copyForwardingHeaders.cmd:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161283 268f45cc-cd09-0410-ab3c-d52691b4dbfc
setup-git-clone fails to get email address from git
https://bugs.webkit.org/show_bug.cgi?id=126446

Reviewed by Ryosuke Niwa.

The setup-git-clone command fails to get an email address from git
because of a bug in VCSUtils. This patch fixes that bug, and also
makes it so that when VCSUtils fails for real because of a local
misconfiguration, the error message is actually presented to the user
of setup-git-clone.

* Scripts/VCSUtils.pm:
(gitConfig): Call isGit() instead of accessing $isGit directly to make
    sure that $isGit is properly initialized.
* Scripts/webkitpy/tool/commands/setupgitclone.py:
(SetupGitClone.execute): Pull out username and email acquistion to
    it's own method.
(SetupGitClone._get_username_and_email): Catch the exception thrown
    when VCSUtils fails and print out the error message so that the
    user actually knows why the command failed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161284 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WebGL] glScissor test is not accounted for when generating internal rendering textures.
https://bugs.webkit.org/show_bug.cgi?id=126455
<rdar://problem/15744206>

Reviewed by Dean Jackson.

Covered by webgl/1.0.2/conformance/rendering/gl-scissor-test.html

* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::prepareTexture): Check state of GL_SCISSOR_TEST and GL_DITHER, deactivate them during
our internal drawing, then turn them back on for further processing.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161285 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Upstream WebCore/css changes
https://bugs.webkit.org/show_bug.cgi?id=126237

Reviewed by Simon Fraser.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue): Added iOS-specific code and FIXME comment.
* css/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext): Ditto.
(WebCore::CSSParser::parseValue): Ditto.
* css/CSSPropertyNames.in: Added property -webkit-composition-fill-color. Also added FIXME comment.
* css/CSSValueKeywords.in: Added iOS-specific -apple-system-* values.
* css/DeprecatedStyleBuilder.cpp:
(WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder): Added iOS-specific code and FIXME comments.
* css/MediaFeatureNames.h: Added media feature -webkit-video-playable-inline.
* css/MediaQueryEvaluator.cpp:
(WebCore::isRunningOnIPhoneOrIPod): Added. Also added FIXME comment.
(WebCore::video_playable_inlineMediaFeatureEval): Added.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::canShareStyleWithElement): Substitute toHTMLMediaElement() for toMediaElement().
(WebCore::StyleResolver::applyProperty): Added iOS-specific code and FIXME comment.
* css/html.css: Added iOS-specific CSS styles.
(input, textarea, keygen, select, button, isindex):
(isindex):
(input[type="date"]):
(input[type="datetime"]):
(input[type="datetime-local"]):
(input[type="month"]):
(input[type="time"]):
(textarea):
(input:-webkit-autofill):
(input[type="radio"], input[type="checkbox"]):
(input[type="button"], input[type="submit"], input[type="reset"], input[type="file"]::-webkit-file-upload-button, button):
(input[type="range"]::-webkit-slider-thumb, input[type="range"]::-webkit-media-slider-thumb):
(input[type="range"]::-webkit-slider-thumb:active):
(input:disabled, textarea:disabled):
(input[readonly], textarea[readonly]):
(textarea::-webkit-input-placeholder):
(input[type="checkbox"]):
(input[type="radio"]):
(input[type="checkbox"]:checked, input[type="radio"]:checked):
(input[type="checkbox"]:checked:disabled, input[type="radio"]:checked:disabled):
(select:focus):
(select):
* css/mathml.css: Added iOS-specific CSS styles.
(math, mfenced > *):
(mo, mfenced):
* css/mediaControlsiOS.css: Added.
* css/svg.css: Added iOS-specific CSS styles.
(text, tspan, tref):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161286 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Small build fix for the GTK+ CMake port

* PlatformGTK.cmake: Add an IDL file that is missing from the list of IDLs
used to generate GObject DOM bindings.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161287 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add lineageOfType renderer iterator and start using it.
<https://webkit.org/b/126456>

Add a convenient way to iterate over a renderers ancestry *including*
the starting point renderer (if it meets the type criteria.)

This works just like lineageOfType for Elements.

Reviewed by Geoffrey Garen.

* rendering/RenderAncestorIterator.h:
(WebCore::lineageOfType):

    Added. Returns an adapter for walking a renderer's entire lineage
    matching any renderer of the given type.

* rendering/RenderBoxModelObject.h:
* rendering/RenderLayerModelObject.h:

    Add the requisite isRendererOfType<T> helpers.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::enclosingFloatPaintingLayer):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::enclosingLayer):
(WebCore::RenderObject::enclosingBox):
(WebCore::RenderObject::enclosingBoxModelObject):

    Simplify with lineageOfType. Added some FIXMEs about functions
    that should return references instead of pointers.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161288 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2][CoordinatedGraphics] Removing repeated protected keyword in WebView
https://bugs.webkit.org/show_bug.cgi?id=126462

Reviewed by Simon Fraser.

* UIProcess/CoordinatedGraphics/WebView.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161289 268f45cc-cd09-0410-ab3c-d52691b4dbfc
build.webkit.org/dashboard says "failed build" even if it's another step that failed
https://bugs.webkit.org/show_bug.cgi?id=126461

Reviewed by Geoffrey Garen.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotBuilderQueueView.js:
(BuildbotBuilderQueueView.prototype.update.appendBuilderQueueStatus): Link to main
build page if it's not the compilation that failed. Use text from buildbot for description.
Show a yellow icon if it's a different kind of failure.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotIteration.js:
(BuildbotIteration.prototype.update): Record whether it was compile-webkit step that failed.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161290 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove SPI, user default for disabling process suppression
https://bugs.webkit.org/show_bug.cgi?id=126458

Reviewed by Sam Weinig.

* Shared/API/c/WKDeprecatedFunctions.cpp:
(WKContextGetProcessSuppressionEnabled):
(WKContextSetProcessSuppressionEnabled):
    - depracated SPI.
* UIProcess/API/C/mac/WKContextPrivateMac.mm:
    - depracated SPI.
* UIProcess/WebContext.cpp:
(WebKit::WebContext::WebContext):
    - removed m_processSuppressionEnabled.
* UIProcess/WebContext.h:
    - removed setProcessSuppressionEnabled, processSuppressionEnabled implementation,
      processSuppressionEnabledChanged, m_processSuppressionEnabled.
* UIProcess/mac/WebContextMac.mm:
(WebKit::WebContext::platformInitialize):
    - removed m_processSuppressionEnabled.
(WebKit::WebContext::processSuppressionEnabled):
    - check whether all pages in all processes are suppressible.
(WebKit::WebContext::canEnableProcessSuppressionForNetworkProcess):
    - removed call to omitProcessSuppression, m_processSuppressionEnabled -> processSuppressionEnabled().
(WebKit::WebContext::canEnableProcessSuppressionForWebProcess):
    - removed call to omitProcessSuppression, processSuppressionEnabled (we don't care if a page in a difference process is not suppresible).
(WebKit::WebContext::canEnableProcessSuppressionForGlobalChildProcesses):
    - removed call to omitProcessSuppression, s_processSuppressionEnabledForAllContexts -> processSuppressionIsEnabledForAllContexts().



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cocoa] Expose session state API
https://bugs.webkit.org/show_bug.cgi?id=126463

Reviewed by Sam Weinig.

* UIProcess/API/Cocoa/WKBrowsingContextController.h: Declared new property and method.
* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
(-[WKBrowsingContextController sessionState]): Added. Calls WebPageProxy::sessionStateData.
(-[WKBrowsingContextController restoreFromSessionState:]): Added. Calls
WebPageProxy::restoreFromSessionState.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161292 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Give all PlatformCALayers a PlatformLayerID, not just remote ones
https://bugs.webkit.org/show_bug.cgi?id=126466

Reviewed by Tim Horton.

Source/WebCore:

The ScrollingStateTree has references to both GraphicsLayers and PlatformLayers
which is confusing, and is necessary because the underlying PlatformLayer
inside a GraphicsLayer can change. In order to hide some of this complexity,
expose GraphicsLayer::primaryLayerID() which is a PlatformLayerID that clients
can hold onto to test for underlying layer swapping.

Also constify LayerType m_layerType on PlatformCALayer, which required
cleaning up the construction of PlatformCALayerMac in the case where a
PlatformCALayerMac is wrapping an existing CALayer (which happens for video).

* WebCore.exp.in:
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::primaryLayerID):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::primaryLayerID):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayer.cpp:
(WebCore::generateLayerID):
(WebCore::PlatformCALayer::PlatformCALayer):
* platform/graphics/ca/PlatformCALayer.h:
(WebCore::PlatformCALayer::layerID):
* platform/graphics/ca/mac/PlatformCALayerMac.h:
* platform/graphics/ca/mac/PlatformCALayerMac.mm:
(PlatformCALayerMac::create):
(PlatformCALayerMac::PlatformCALayerMac):
(PlatformCALayerMac::commonInit):

Source/WebKit2:

The ScrollingStateTree has references to both GraphicsLayers and PlatformLayers
which is confusing, and is necessary because the underlying PlatformLayer
inside a GraphicsLayer can change. In order to hide some of this complexity,
expose GraphicsLayer::primaryLayerID() which is a PlatformLayerID that clients
can hold onto to test for underlying layer swapping.

GraphicsLayerCARemote and PlatformCALayerRemote can now just use the
primaryLayerID() function exposed via the base class.

* WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp:
* WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(PlatformCALayerRemote::PlatformCALayerRemote):
(PlatformCALayerRemote::recursiveBuildTransaction):
* WebProcess/WebPage/mac/PlatformCALayerRemote.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161293 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WebGL] CGLPixelFormat should specify SampleBuffer and Sample count when using MSAA
https://bugs.webkit.org/show_bug.cgi?id=126468

Reviewed by Dean Jackson.

Covered by webgl/1.0.2/resources/webgl_test_files/conformance/rendering/gl-scissor-test.html

* platform/graphics/mac/GraphicsContext3DMac.mm:
(WebCore::setPixelFormat): Add kCGLPFAMultisample, kCGLPFASampleBuffers (and count), and
kCGLPFASamples (and count) to our pixel format when 'antialias=true'.
(WebCore::GraphicsContext3D::GraphicsContext3D): Pass a new 'antialias' flag to the setPixelFormat
method so we can turn on MSAA features when needed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161294 268f45cc-cd09-0410-ab3c-d52691b4dbfc
It's confusing to have two elements link to the same URL at build.webkit.org/dashboard
https://bugs.webkit.org/show_bug.cgi?id=126467

Reviewed by Geoffrey Garen.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/StatusLineView.js:
(StatusLineView): Don't linkify the label text, the bubble is easier to target with mouse
pointer, or to tap.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161295 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] [WK2] TileController creates all tiles on first paint, making it slow and consuming lots of memory
https://bugs.webkit.org/show_bug.cgi?id=126457

Reviewed by Simon Fraser.

Instead of making all of the tiles all of the time, we should use the
view-exposed-rect mechanism to inform TileController about what portion
of the WKContentView is currently exposed by the WKScrollView.

* UIProcess/API/ios/WKContentView.h:
* UIProcess/API/ios/WKContentView.mm:
(-[WKContentView setViewportSize:]):
(-[WKContentView didFinishScrollTo:]):
(-[WKContentView didScrollTo:]):
Inform the WebPageProxy that our exposed rect changed.

* UIProcess/API/ios/WKView.mm:
(-[WKView scrollViewDidScroll:]):
Inform the WKContentView that we've scrolled at all.
Rename the existing WKContentView didScrollTo: to didFinishScrollTo:,
because it is expected to only fire when a scroll lands. Add didScrollTo:,
which fires continually as scrolling progresses.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::viewExposedRectChanged):
(WebKit::WebPageProxy::exposedRectChangedTimerFired):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::viewExposedRect):
* UIProcess/mac/WebPageProxyMac.mm:
Move view-exposed-rect stuff to WebPageProxy so it can be built on both
Mac and iOS, and un-!PLATFORM(IOS) some of the related members.

* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::setExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::setClipsToExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::updateMainFrameClipsToExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameTiledBacking):
Steal TiledCoreAnimationDrawingArea's exposed-rect code.
Note that on iOS, we don't need to manually offset the exposed rect by
the scroll position, because the scroll position is already baked into
the exposed rect, and WebCore's notion of the scroll position will be
inaccurate until the scroll lands.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161296 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WebGL] Blit operation from Multisample FBO to rendering FBO must ignore GL_SCISSOR test
https://bugs.webkit.org/show_bug.cgi?id=126470
<rdar://problem/15201370>

Reviewed by Dean Jackson.

Covered by webgl/1.0.2/resources/webgl_test_files/conformance/rendering/gl-scissor-test.html

* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
(WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary): Temporarily deactivate the GL_SCISSOR
test while we do our blit, then reactivate if necessary.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161297 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r161274.
http://trac.webkit.org/changeset/161274
https://bugs.webkit.org/show_bug.cgi?id=126475

Volates ECMA and WebGL Specification (Requested by bfulgham on
#webkit).

* webgl/1.0.2/resources/webgl_test_files/conformance/typedarrays/data-view-test.html:

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