REGRESSION (r165972): Can't type into text fields in Flash
https://bugs.webkit.org/show_bug.cgi?id=132840
<rdar://problem/16671969>

Reviewed by Anders Carlsson.

* UIProcess/API/mac/WKView.mm: (-[WKView inputContext]): Restore a function that
got accidentally lost when adding async text input code.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168654 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Content shadow layer needs to move in sync with the content layer
https://bugs.webkit.org/show_bug.cgi?id=132841
-and corresponding-
<rdar://problem/16641115>

Reviewed by Simon Fraser.

Now that the root content layer moves a little bit (for y scroll positions between 
0 and topContentInset), the shadow layer needs to move along with it since the 
shadow layer should always have the same position as the root content layer.

Set the root state node’s shadow layer, and update the position whenever the root 
content layer’s position is updated.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):

Fetch the compositor’s layerForContentShadow().
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::contentShadowLayerForFrameView):
* page/scrolling/ScrollingCoordinator.h:

Hook up the contentShadowLayer in the state node.
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
(WebCore::ScrollingStateScrollingNode::setContentShadowLayer):

Hook it up in the ScrollingTreeNode as well. Move the layer whenever the m
_scrolledContentsLayer is moved.
* page/scrolling/ScrollingStateScrollingNode.h:
* page/scrolling/mac/ScrollingTreeScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
(WebCore::ScrollingTreeScrollingNodeMac::updateBeforeChildren):
(WebCore::ScrollingTreeScrollingNodeMac::setScrollLayerPosition):

The shadow layer needs an anchor point now that we are moving it around.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168655 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Don't make a Frameworks symlink inside WebKitLegacy.framework
https://bugs.webkit.org/show_bug.cgi?id=132842
<rdar://problem/16886939>

Reviewed by Dan Bernstein.

* WebKit.xcodeproj/project.pbxproj:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168656 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Triple-buffer RemoteLayerBackingStore
https://bugs.webkit.org/show_bug.cgi?id=132786
<rdar://problem/16877498>

Reviewed by Simon Fraser.

We need three buffers because we're currently unable to synchronize
with the render server to swap when they're not in use, so we were
throwing surfaces away far too frequently.

This hugely reduces time spent in IOSurface::create on various repaint benchmarks.

* Shared/mac/RemoteLayerBackingStore.h:
(WebKit::RemoteLayerBackingStore::hasFrontBuffer):
(WebKit::RemoteLayerBackingStore::volatility): Deleted.
* Shared/mac/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::RemoteLayerBackingStore):
(WebKit::RemoteLayerBackingStore::clearBackingStore):
(WebKit::RemoteLayerBackingStore::encode):
(WebKit::RemoteLayerBackingStore::decode):
(WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
(WebKit::RemoteLayerBackingStore::display):
(WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer):
(WebKit::RemoteLayerBackingStore::setBufferVolatility):
(WebKit::RemoteLayerBackingStore::Buffer::discard):
(WebKit::RemoteLayerBackingStore::setVolatility): Deleted.
* Shared/mac/RemoteLayerBackingStoreCollection.mm:
(WebKit::RemoteLayerBackingStoreCollection::purgeabilityTimerFired):
Put the ShareableBitmap/IOSurface and a volatility bit in a Buffer struct.
Also factor out "throw away this buffer and put it in the pool" into Buffer::discard().
We keep a volatility bit because querying IOSurface purgeability is expensive,
and we have a guarantee that any changes will happen in the Web process
and go through this class (the lack of this guarantee in most cases is why I'm not
putting this bit in WebCore::IOSurface itself).

Make it so that each buffer's volatility can be adjusted individually
by setBufferVolatility(), and adopt in RemoteLayerBackingStoreCollection.

Add a third buffer, m_secondaryBackBuffer, which will swap with the back buffer
before swapping front and back if the back buffer (soon to be the front buffer)
is still in use by the render server. This means that we will almost never
have to throw away a surface because it's in use (and conversely never need
to make a new surface).

Adjust RemoteLayerBackingStoreCollection to make secondary back surfaces purgeable
more aggressively than others.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168657 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Followup to "Teach Editor to support more direct replacement of a Node"
<rdar://problem/16817952> and https://bugs.webkit.org/show_bug.cgi?id=132834

Pair programmed and pair reviewed by Brady Eidson and Darin Adler.

* editing/mac/EditorMac.mm:
(WebCore::maybeCopyNodeAttributesToFragment):
(WebCore::Editor::replaceNodeFromPasteboard):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168658 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add debug dumping for ViewportConfiguration
https://bugs.webkit.org/show_bug.cgi?id=132843

Reviewed by Benjamin Poulain.

Add some TextStream-based dumping for ViewportConfiguration.

* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::updateConfiguration):
(WebCore::ViewportConfigurationTextStream::ViewportConfigurationTextStream):
(WebCore::ViewportConfigurationTextStream::increaseIndent):
(WebCore::ViewportConfigurationTextStream::decreaseIndent):
(WebCore::dumpProperty):
(WebCore::ViewportConfigurationTextStream::writeIndent):
(WebCore::ViewportConfigurationTextStream::operator<<):
(WebCore::ViewportConfiguration::description):
(WebCore::ViewportConfiguration::dump):
* page/ViewportConfiguration.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168660 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS WK2] Fuzzy tiles on some sites on loading
https://bugs.webkit.org/show_bug.cgi?id=132847
<rdar://problem/16816178>

Reviewed by Benjamin Poulain.

Source/WebCore:

Export WebCore::TileController::contentsScale() const

* WebCore.exp.in:

Source/WebKit2:

PlatformCALayerRemoteTiledBacking overrode setContentsScale() but not contentsScale(),
causing us to early-return from GraphicsLayerCA::updateContentsScale() and leave the
scale wrong. Fix by overriding contentsScale() also.

* WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
(WebKit::PlatformCALayerRemoteTiledBacking::contentsScale):
* WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h:

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

* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::contentShadowLayerForFrameView):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168662 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, EFL build fix since r168625.

* UIProcess/efl/WebContextEfl.cpp:
(WebKit::WebContext::platformDefaultLocalStorageDirectory): Remove const keyword.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168663 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DataDetectorUI doesn't update with resize
https://bugs.webkit.org/show_bug.cgi?id=132830
<rdar://problem/16871179>

Reviewed by Simon Fraser.

* editing/Editor.cpp:
(WebCore::Editor::scanSelectionForTelephoneNumbers): Add public, no-argument
version that can be called after layout changes.
(WebCore::Editor::didLayout): Reprocess telephone number data
since Ranges will have changed.
* editing/Editor.h:
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::updateDataDetectorsForSelection): Added.
* editing/FrameSelection.h:
* page/FrameView.cpp:
(WebCore::FrameView::performPostLayoutTasks): Ask the FrameSelection to update the
Range information for selected phone numbers.


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

* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::contentShadowLayerForFrameView):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168665 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Limit number of active graphics contexts per web process.
https://bugs.webkit.org/show_bug.cgi?id=132833.
<rdar://problem/16888459>

Reviewed by Dean Jackson.

Test: webgl/many-contexts.html

* platform/graphics/GraphicsContext3D.h:
* platform/graphics/mac/GraphicsContext3DMac.mm: Limit number of active contexts to 16.
(WebCore::GraphicsContext3D::create):
(WebCore::GraphicsContext3D::~GraphicsContext3D):
* webgl/many-contexts-expected.txt: Added.
* webgl/many-contexts.html: Added.


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