REGRESSION (r133807): Sticky-position review bar on bugzilla review page is jumpy
https://bugs.webkit.org/show_bug.cgi?id=104276
<rdar://problem/12827187>

Reviewed by Tim Horton.

When committing new scrolling tree state, if the root node has a scroll
position update, we would handle that before updating the state of child
nodes (with possibly new viewport constraints). That would cause incorrect
child layer updates.

Fix by adding a second 'update' phase that happens after child nodes,
and moving the scroll position update into that.

Scrolling tests only dump the state tree, so cannot test the bug.

* page/FrameView.cpp:
(WebCore::FrameView::setScrollPosition): If the scroll position didn't
actually change, don't request a scroll position update from the ScrollingCoordinator.
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::updateTreeFromStateNode): Keep track of the scrolling node so
that we can call updateAfterChildren() on it.
* page/scrolling/ScrollingTreeNode.h:
(ScrollingTreeNode):
(WebCore::ScrollingTreeNode::updateAfterChildren):
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::updateBeforeChildren):
* page/scrolling/ScrollingTreeScrollingNode.h:
(ScrollingTreeScrollingNode):
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::updateViewportConstrainedNode):
In the current bug the scrolling tree was scheduled for commit because of a
scroll position request, but if only the viewport constraints change, we also need
to commit the tree.
* page/scrolling/mac/ScrollingTreeFixedNode.h:
(ScrollingTreeFixedNode):
* page/scrolling/mac/ScrollingTreeFixedNode.mm:
(WebCore::ScrollingTreeFixedNode::updateBeforeChildren):
* page/scrolling/mac/ScrollingTreeScrollingNodeMac.h:
(ScrollingTreeScrollingNodeMac):
* page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
(WebCore::ScrollingTreeScrollingNodeMac::updateBeforeChildren):
(WebCore::ScrollingTreeScrollingNodeMac::updateAfterChildren): Move code here
that updates things that have to happen after children.
* page/scrolling/mac/ScrollingTreeStickyNode.h:
(ScrollingTreeStickyNode):
* page/scrolling/mac/ScrollingTreeStickyNode.mm:
(WebCore::ScrollingTreeStickyNode::updateBeforeChildren):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142520 268f45cc-cd09-0410-ab3c-d52691b4dbfc
PluginProcess should quit immediately if idle in response to low-memory notifications
https://bugs.webkit.org/show_bug.cgi?id=109103
<rdar://problem/12679827>

Reviewed by Brady Eidson.

Source/WebCore: 

This patch allows a process to set a custom callback for low memory warnings
(defaulting to the current behaviour, as implemented in releaseMemory).

* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::MemoryPressureHandler):
    - Initialize m_lowMemoryHandler to releaseMemory.
(WebCore::MemoryPressureHandler::install):
(WebCore::MemoryPressureHandler::uninstall):
(WebCore::MemoryPressureHandler::holdOff):
    - Cleaned up spacing.
(WebCore::MemoryPressureHandler::releaseMemory):
    - Added null implementation for non-Mac builds.
* platform/MemoryPressureHandler.h:
(WebCore::MemoryPressureHandler::setLowMemoryHandler):
    - Added method to set m_lowMemoryHandler.
* platform/mac/MemoryPressureHandlerMac.mm:
(WebCore::MemoryPressureHandler::respondToMemoryPressure):
    - Changed to call releaseMemory via m_lowMemoryHandler.

Source/WebKit2: 

PluginProcess now installs a MemoryPressureHandler for the process, providing
a custom callback which will call terminate if appropriate (if the plugin is not
currently in use).

* PluginProcess/PluginProcess.cpp:
(WebKit::PluginProcess::lowMemoryHandler):
    - Custom callback to terminate if appropriate.
(WebKit::PluginProcess::initializeProcess):
    - Install the MemoryPressureHandler.
(WebKit::PluginProcess::shouldTerminate):
    - This method now also needs to be callable in situations where it might return false.
* PluginProcess/PluginProcess.h:
(PluginProcess):
    - Added declaration for lowMemoryHandler.



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