Improve stringProtoFuncLastIndexOf for the prefix case
https://bugs.webkit.org/show_bug.cgi?id=115952

Reviewed by Geoffrey Garen.

Source/JavaScriptCore: 

* runtime/StringPrototype.cpp:
(JSC::stringProtoFuncLastIndexOf):
Use the optimized string search when possible.

On Joseph Pecoraro's tests, this gives a ~30% speed improvement.

Source/WTF: 

Add an optimized version of StringImpl::startsWith() for JavaScriptCore.

* wtf/text/StringImpl.cpp:
(WTF::StringImpl::startsWith):
* wtf/text/StringImpl.h:
(StringImpl):
(WTF::StringImpl::startsWith):
* wtf/text/WTFString.h:
(WTF::String::startsWith):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150042 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Headers and footers should be pinned to the left edge of the window when scrolling 
horizontally
https://bugs.webkit.org/show_bug.cgi?id=116061
-and corresponding-
<rdar://problem/13599215>

Reviewed by Simon Fraser.

The scrolling thread will need to know about the header and footer layers in order 
the implement this custom scrolling behavior. 

These getters will fetch the header or footer layer from the FrameView as 
appropriate.
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::headerLayerForFrameView):
(WebCore::ScrollingCoordinator::footerLayerForFrameView):
* page/scrolling/ScrollingCoordinator.h:

When we’re scrolling on the main thread, adjust the position of the header and 
footer layers here.
(WebCore::ScrollingCoordinator::updateMainFrameScrollPosition):

ScrollingStateScrollingNode now stores GraphicsLayers and PlatformLayers for the 
header and footer, just like it already does for the counterScrollingLayer.
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
* page/scrolling/ScrollingStateScrollingNode.h:
(ScrollingStateScrollingNode):
(WebCore::ScrollingStateScrollingNode::headerLayer):
(WebCore::ScrollingStateScrollingNode::footerLayer):

Setters for the new layers.
* page/scrolling/mac/ScrollingCoordinatorMac.h:
(ScrollingCoordinatorMac):
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::frameViewRootLayerDidChange):
(WebCore::ScrollingCoordinatorMac::setHeaderLayerForNode):
(WebCore::ScrollingCoordinatorMac::setFooterLayerForNode):

These setters and getters mirror the existing one for counterScrollingLayer.
* page/scrolling/mac/ScrollingStateScrollingNodeMac.mm:
(WebCore::ScrollingStateScrollingNode::headerPlatformLayer):
(WebCore::ScrollingStateScrollingNode::setHeaderLayer):
(WebCore::ScrollingStateScrollingNode::footerPlatformLayer):
(WebCore::ScrollingStateScrollingNode::setFooterLayer):

And the ScrollingTree will store CALayers for the header and footer.
* page/scrolling/mac/ScrollingTreeScrollingNodeMac.h:
(ScrollingTreeScrollingNodeMac):
* page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
(WebCore::ScrollingTreeScrollingNodeMac::updateBeforeChildren):

This is where the magic happens when we are scrolling on the scrolling thread. 
Adjust the horizontal position the behave like a fixed object, but keep the 
vertical position what it was when layer was created.
(WebCore::ScrollingTreeScrollingNodeMac::setScrollLayerPosition):

RenderLayerCompositor must now provide getters for the header and footer.
* rendering/RenderLayerCompositor.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::headerLayer):
(WebCore::RenderLayerCompositor::footerLayer):

Set the anchor point for when we adjust the position later on. Also call 
frameViewRootLayerDidChange() to get the new layers picked up and sent to the 
scrolling tree.
(WebCore::RenderLayerCompositor::updateLayerForHeader):
(WebCore::RenderLayerCompositor::updateLayerForFooter):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150043 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove ChromeClient::willPopupMenu
https://bugs.webkit.org/show_bug.cgi?id=116063

Reviewed by Andreas Kling.

Source/WebCore:

Remove ChromeClient::willPopupMenu.

* page/ChromeClient.h:

Source/WebKit/mac:

ChromeClient::willPopupMenu is only called in one place from WebKit, so just move the function to the call site.

* WebCoreSupport/PopupMenuMac.mm:
(PopupMenuMac::show):
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:

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