Subpixel rendering: Fieldset legend has a horizontal line through, when the fieldset is painted on odd device pixel position.
https://bugs.webkit.org/show_bug.cgi?id=132521
<rdar://problem/16803305>

Reviewed by Simon Fraser.

Use device pixel snapping when the fieldset's border gets clipped out for the legend's text. It ensures that
the device pixel snapped border gets properly clipped out.

Existing fieldset tests cover it.

* rendering/RenderFieldset.cpp:
(WebCore::RenderFieldset::paintBoxDecorations):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168221 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Fix GTK+ build after r168209.

* platform/leveldb/LevelDBDatabase.cpp:
(WebCore::LevelDBDatabase::write):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168222 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Subpixel rendering: Add hidpi fieldset/legend test case to check fieldset's cliprect when legend text is present.
https://bugs.webkit.org/show_bug.cgi?id=132524

Reviewed by Simon Fraser.

This is the hidpi test for r168221. (Fieldset legend has a horizontal line
through, when the fieldset is painted on odd device pixel position.)

* fast/forms/hidpi-fieldset-on-subpixel-position-when-legend-is-present-expected.html: Added.
* fast/forms/hidpi-fieldset-on-subpixel-position-when-legend-is-present.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168223 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CMake] Define SHOULD_INSTALL_JS_SHELL before including ports Options files.
https://bugs.webkit.org/show_bug.cgi?id=132525

Reviewed by Martin Robinson.

* CMakeLists.txt: If OPTION() is called after Options${PORT}.cmake is included, it will
override whatever value a port may have set for it. The GTK+ port, for example, tries to set
it to SHOULD_INSTALL_JS_SHELL to ON by default, even though it did not happen before.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168225 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix crash in WebKit client app when zooming
https://bugs.webkit.org/show_bug.cgi?id=132475
<rdar://problem/16703405>

Reviewed by Tim Horton.

It's possible for a WebTiledBackingLayer CALayer to remain in the CALayer
hierarchy after we've called -invalidate on it, which clears the _tileController.
Project the getters against null derefs to handle this.

* platform/graphics/ca/mac/WebTiledBackingLayer.mm:
(-[WebTiledBackingLayer isOpaque]):
(-[WebTiledBackingLayer acceleratesDrawing]):
(-[WebTiledBackingLayer contentsScale]):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168226 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Very fuzzy layers under non-decompasable matrices
https://bugs.webkit.org/show_bug.cgi?id=132516
<rdar://problem/16717478>

Reviewed by Sam Weinig.

Source/WebCore:
r155977 added code to modify layer contentsScale based on a root-relative
scale, so that scaled-up layers remained sharp. It does this by decomposing
an accumulated matrix, but failed to test whether the decomposition
succeeded. This would result in contentsScale of 0, which is clamped to 0.1,
resulting in very fuzzy layers.

Fix by testing for success of decomposition.

Test: compositing/contents-scale/non-decomposable-matrix.html

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::maxScaleFromTransform):
* platform/graphics/transforms/TransformationMatrix.cpp:
(WebCore::TransformationMatrix::decompose2): Return early for identity matrices,
with fix for m11 and m22.
(WebCore::TransformationMatrix::decompose4): Return early for identity matrices.
* platform/graphics/transforms/TransformationMatrix.h:
Make Decomposed2Type and Decomposed4Type into C++ structs.
(WebCore::TransformationMatrix::Decomposed2Type::operator==): Added to make it easier
to write code that asserts that decomposition is correct.
(WebCore::TransformationMatrix::Decomposed4Type::operator==): Ditto.

LayoutTests:
Compare scaling under non-decomposable and decomposable matrices.

* compositing/contents-scale/non-decomposable-matrix-expected.html: Added.
* compositing/contents-scale/non-decomposable-matrix.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168227 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[UI-side compositing] Assertion in PlatformCAFilters::setFiltersOnLayer with animated reference filter
https://bugs.webkit.org/show_bug.cgi?id=132528
<rdar://problem/16671660>

Reviewed by Tim Horton.

Source/WebKit2:
Allow PASSTHROUGH filters to be encoded and sent to the UI process; they can be set
on layers as the result of a filter animation using a reference filter, and just get
ignored anyway, but encoding them maintains consistency of the filters list.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<FilterOperation>::encode): Assert during encoding if
we try to encode a NONE or REFERENCE filter (to match the decoding assertions).
(IPC::decodeFilterOperation): Allow decoding of PASSTHROUGH filters. Have
trying to decode a NONE or REFERENCE filter mark the message as invalid.
(IPC::ArgumentCoder<IDBKeyData>::decode): Mark the message invalid when receiving
unexpected key types.
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTextStream::operator<<): Have the logging not crash if
a filter is null (should never happen).

LayoutTests:
Make the animation duration a little longer to cause bug 132528 to reproduce more
reliably. The test does notifyDone() from an animation start event, so this doesn't
increase test duration.

* css3/filters/crash-filter-animation-invalid-url.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168228 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cocoa WebKit2] Add basic _WKWebsiteDataStore implementation
https://bugs.webkit.org/show_bug.cgi?id=132526

Reviewed by Anders Carlsson.

- Renames WKSession to _WKWebsiteDataStore to better reflect its intended use (renaming
  the implementation object will come later).
- Makes _WKWebsiteDataStore work as a wrapped Objective-C object.
- Adds the ability to set a _WKWebsiteDataStore on the WKWebViewConfiguration.

* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
* UIProcess/API/Cocoa/WKSession.h:
* UIProcess/API/Cocoa/WKSession.mm:
(-[WKSession dealloc]): Deleted.
(-[WKSession ephemeral]): Deleted.
(-[WKSession API::]): Deleted.
* UIProcess/API/Cocoa/WKSessionInternal.h:
(WebKit::wrapper): Deleted.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _websiteDataStore]):
(-[WKWebViewConfiguration _setWebsiteDataStore:]):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStore.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKSession.h.
* UIProcess/API/Cocoa/_WKWebsiteDataStore.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKSession.mm.
(+[_WKWebsiteDataStore nonPersistentDataStore]):
(-[_WKWebsiteDataStore isNonPersistentDataStore]):
(-[WKSession ephemeral]): Deleted.
* UIProcess/API/Cocoa/_WKWebsiteDataStoreInternal.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKSessionInternal.h.
* WebKit2.xcodeproj/project.pbxproj:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168229 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Invalidate scrollbars when custom scrollbar style changes dynamically.
<https://webkit.org/b/132529>

Source/WebCore:
Add a ScrollView::styleDidChange() and call that from RenderView::styleDidChange()
so that the scrollbars are sure to get repainted with potentially different style.

Reviewed by Antti Koivisto.

Test: fast/css/scrollbar-dynamic-style-change.html

* platform/ScrollView.cpp:
(WebCore::ScrollView::styleDidChange):
* platform/ScrollView.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::styleDidChange):

LayoutTests:
Reviewed by Antti Koivisto.

* fast/css/scrollbar-dynamic-style-change-expected.html: Added.
* fast/css/scrollbar-dynamic-style-change.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168230 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reduce calls to CFURLCacheCopySharedURLCache
https://bugs.webkit.org/show_bug.cgi?id=132464
<rdar://problem/16806694>

Reviewed by Alexey Proskuryakov.

CFURLCacheCopySharedURLCache grabs a mutex and can sometimes block. Avoid that by stashing
the cache reference in a static.

* NetworkProcess/NetworkResourceLoader.h: Coalesce ifdef'd code.
* NetworkProcess/mac/NetworkResourceLoaderMac.mm:
(WebKit::NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer):
(WebKit::NetworkResourceLoader::willCacheResponseAsync): Use more correct ifdef for
Foundation based callback.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Shortcircuit shouldUseCredentialStorage callback
https://bugs.webkit.org/show_bug.cgi?id=132308
<rdar://problem/16806708>

Reviewed by Alexey Proskuryakov.

If we are going to return true from the shouldUseCredentialStorage callback then we don't
really need to have CFNetwork/Foundation call us. We can just disable the callback and
CFNetwork will assume true. Add a separate subclass that implements this callback when we
need to return false. We can also eliminate the corresponding async callbacks. This avoids
pingponging between dispatch queue and main thread in the common case.

No new tests because no change in functionality.

Source/WebCore:
* WebCore.exp.in:
* platform/network/ResourceHandle.cpp:
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleClient.cpp:
* platform/network/ResourceHandleClient.h:
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::createCFURLConnection):
(WebCore::ResourceHandle::shouldUseCredentialStorage):
* platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::shouldUseCredentialStorage):
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h:
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::makeDelegate):
(WebCore::ResourceHandle::delegate):
(WebCore::ResourceHandle::platformLoadResourceSynchronously):
(WebCore::ResourceHandle::shouldUseCredentialStorage):
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleWithCredentialStorageAsOperationQueueDelegate connectionShouldUseCredentialStorage:]):
* platform/network/soup/ResourceHandleSoup.cpp:

Source/WebKit2:
* NetworkProcess/NetworkResourceLoader.cpp: Remove shouldUseCredentialStorageAsync() callbacks.
* NetworkProcess/NetworkResourceLoader.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168232 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS][WK2] Support disabling speculative tiling
https://bugs.webkit.org/show_bug.cgi?id=132512

Reviewed by Tim Horton.

Move ScrollView::setScrollVelocity() and ScrollView::computeCoverageRect() to FrameView.
When speculative tiling is disabled, return an unmodified exposed rect.

Time/velocity adjusments are completely unnecessary at the moment since speculative tiling
is enabled as soon as the view scrolls.

* WebCore.exp.in:
* page/FrameView.cpp:
(WebCore::FrameView::setScrollVelocity):
(WebCore::FrameView::computeCoverageRect):
* page/FrameView.h:
* platform/ScrollView.h:
* platform/ios/ScrollViewIOS.mm:
(WebCore::ScrollView::setScrollVelocity): Deleted.
(WebCore::ScrollView::computeCoverageRect): Deleted.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168233 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] REGRESSION (WebKit2): Page isn't clipped properly during back/forward swipe
https://bugs.webkit.org/show_bug.cgi?id=132538
<rdar://problem/16266027>

Reviewed by Simon Fraser.

* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::beginSwipeGesture):
(WebKit::ViewGestureController::endSwipeGesture):
* UIProcess/mac/ViewGestureController.h:
Add a clipping layer above the live swipe layer, which explicitly clips to bounds.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168234 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Clear the JSString cache when under memory pressure.
<https://webkit.org/b/132539>

The WeakGCMap used for fast mapping from StringImpl* to JSString*
can actually get pretty big, and if we find ourselves under memory
pressure, it's entirely inessential.

1.1 MB progression on Membuster3.

Reviewed by Sam Weinig.

* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::releaseMemory):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168235 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CSS JIT: optimize direct / indirect adjacent's traversal backtracking
https://bugs.webkit.org/show_bug.cgi?id=132319

Patch by Yusuke Suzuki <utatane.tea@gmail.com> on 2014-05-03
Reviewed by Benjamin Poulain.


Source/WebCore: 
Since adjacent backtracking stack reference is pre-allocated
in prologue in http://trac.webkit.org/changeset/166834,
clearing stack phase is not needed. So we can drop
JumpToClearAdjacentTail from backtracking action and simplify
backtracking handling.
And optimize direct / indirect adjacent's traversal backtracking by
using appropriate backtracking height.

When solving adjacent traversal backtracking action,
1) When there's no descendant relation on the right, traversal
failure becomes global failure.
2) When `tagNameMatchedBacktrackingStartHeightFromDescendant` ==
`heightFromDescendant` + 1, the descendant backtracking starts with
the parent of the current element. So we can use the current element
and the backtracking action is JumpToDescendantTreeWalkerEntryPoint.
3) Otherwise, currently we take the conservative approach,
JumpToDescendantTail.

NOTE:
And if `hasDescendantRelationOnTheRight` is true and there's no child
fragment on the right, the backtracking element register is not
effective. So we should ensure that fragment doesn't use the
backtracking element register. Such a fragment fulfills the following
conditions. 1. tagNameMatchedBacktrackingStartHeightFromDescendant is
always 1 (tagNames.size(), that contains only descendant fragment) 2.
heightFromDescendant is always 0 (-- See
computeBacktrackingHeightFromDescendant implementation) Therefore such
a fragment's action always becomes
JumpToDescendantTreeWalkerEntryPoint. So we can ensure that the
backtracking element register is not used.

Test: fast/selectors/backtracking-adjacent.html

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::solveDescendantBacktrackingActionForChild):
(WebCore::SelectorCompiler::solveAdjacentTraversalBacktrackingAction):
(WebCore::SelectorCompiler::solveBacktrackingAction):
(WebCore::SelectorCompiler::SelectorCodeGenerator::computeBacktrackingInformation):
(WebCore::SelectorCompiler::SelectorCodeGenerator::linkFailures):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateAdjacentBacktrackingTail):
(WebCore::SelectorCompiler::isAfterChildRelation): Deleted.

LayoutTests: 
* fast/selectors/backtracking-adjacent-expected.txt: Added.
* fast/selectors/backtracking-adjacent.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168236 268f45cc-cd09-0410-ab3c-d52691b4dbfc
RenderSVGResourcePattern should deal in RenderElement&.
<https://webkit.org/b/132536>

Tweak buildPattern() and buildTileImageTransform() to take RenderElement&
instead of RenderObject* since we know that these functions will always
be called with non-null RenderElement subclasses.

Reviewed by Sam Weinig.

* rendering/svg/RenderSVGResourceContainer.cpp:
(WebCore::RenderSVGResourceContainer::shouldTransformOnTextPainting):
* rendering/svg/RenderSVGResourceContainer.h:
* rendering/svg/RenderSVGResourceGradient.cpp:
(WebCore::RenderSVGResourceGradient::applyResource):
* rendering/svg/RenderSVGResourcePattern.cpp:
(WebCore::RenderSVGResourcePattern::buildPattern):
(WebCore::RenderSVGResourcePattern::applyResource):
(WebCore::RenderSVGResourcePattern::buildTileImageTransform):
* rendering/svg/RenderSVGResourcePattern.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168237 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r168232.
https://bugs.webkit.org/show_bug.cgi?id=132543

broke ~15 tests on WK2 debug (Requested by kling on #webkit).

Reverted changeset:

"Shortcircuit shouldUseCredentialStorage callback"
https://bugs.webkit.org/show_bug.cgi?id=132308
http://trac.webkit.org/changeset/168232

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168241 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Convert OwnPtr to std::unique_ptr in CDM
https://bugs.webkit.org/show_bug.cgi?id=132467

Reviewed by Andreas Kling.

Use std::unique_ptr in CDM class.

No new tests, no behavior change.

* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::create):
(WebCore::CDM::CDM):
* Modules/encryptedmedia/CDM.h:
* Modules/encryptedmedia/CDMPrivateMediaPlayer.h:
(WebCore::CDMPrivateMediaPlayer::CDMPrivateMediaPlayer):
(WebCore::CDMPrivateMediaPlayer::create):
* Modules/encryptedmedia/MediaKeys.cpp:
(WebCore::MediaKeys::create):
(WebCore::MediaKeys::MediaKeys):
* Modules/encryptedmedia/MediaKeys.h:
* WebCore.exp.in:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168242 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Clear the Selector Query caches on memory pressure
https://bugs.webkit.org/show_bug.cgi?id=132545

Reviewed by Andreas Kling.

The Selector Query Cache can use quite a bit of memory if many
complex selectors are compiled. This patch makes sure the cache gets
cleared on memory pressure.

* dom/Document.cpp:
(WebCore::Document::clearSelectorQueryCache):
(WebCore::Document::setCompatibilityMode):
(WebCore::Document::updateBaseURL):
* dom/Document.h:
* dom/SelectorQuery.cpp:
(WebCore::SelectorQueryCache::invalidate): Deleted.
* dom/SelectorQuery.h:
* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::releaseMemory):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168243 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Top content inset: Margin tiles should not display in the inset area when pinned 
to the top of the page
https://bugs.webkit.org/show_bug.cgi?id=132535
-and corresponding-
<rdar://problem/16613039>

Reviewed by Simon Fraser.


Source/WebCore: 
Prior to this change, topContentInset was implemented by positioning 
RenderLayerCompositor’s m_rootContentLayer based on the inset value. In order to 
ensure that no content is displayed in the inset area when we are pinned to the 
top of the page, we’ll have to take a different approach. In this patch, when you 
are pinned to the top of the page, the m_rootContentLayer is positioned at (0,0), 
much like it would be without an inset, but the m_clip layer IS positioned at (0, 
topContentInset). Then for all y-scroll values between 0 and topContentInset, the 
positions of the clip layer and the contents layer are adjusted so that the clip 
layer approaches a position of (0,0), and the root layer approaches a position of 
(0, topContentInset). This makes sure that any content above the top the document 
is aways clipped out of the inset area.

In order to achieve this, the scrolling thread needs to know about the 
topContentInset, the clip layer, and the root contents layer.

AsyncScrollingCoordinator::updateScrollingNode() now takes an additional parameter 
for the clip layer. Also export the topContentInset symbol for UI-side 
compositing.
* WebCore.exp.in:

Here is the new computation. Implemented in one spot that can be called from the 
scrolling thread, AsyncScrollingCoordinator and RenderLayerCompositor.
* page/FrameView.cpp:
(WebCore::FrameView::yPositionForInsetClipLayer):
(WebCore::FrameView::yPositionForRootContentLayer):
* page/FrameView.h:

Set the topContentInset, the insetClipLayer, and the scrolledContentsLayer when 
appropriate.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):

Set or sync the positions for the inset layer and the contents layer.
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
(WebCore::AsyncScrollingCoordinator::updateScrollingNode):
* page/scrolling/AsyncScrollingCoordinator.h:

Convenience functions for getting the clipLayer() and the rootContentLayer() from 
the RenderLayerCompositor.
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::insetClipLayerForFrameView):
(WebCore::ScrollingCoordinator::rootContentLayerForFrameView):
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::updateScrollingNode):

ScrollingStateScrolling nodes have two new members now. m_insetClipLayer and 
m_topContentInset. We can use m_scrolledContentsLayer for the rootContentsLayer 
since previously that member was not used for FrameViews; it was only used for 
accelerated overflow:scroll nodes.
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
(WebCore::ScrollingStateScrollingNode::setTopContentInset):
(WebCore::ScrollingStateScrollingNode::setInsetClipLayer):
* page/scrolling/ScrollingStateScrollingNode.h:

Similarly, ScrollingTreeScrollingNode has two new members for m_topContentInset 
and m_clipLayer.
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::ScrollingTreeScrollingNode):
(WebCore::ScrollingTreeScrollingNode::updateBeforeChildren):
* page/scrolling/ScrollingTreeScrollingNode.h:
(WebCore::ScrollingTreeScrollingNode::topContentInset):
* page/scrolling/mac/ScrollingTreeScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
(WebCore::ScrollingTreeScrollingNodeMac::updateBeforeChildren):

Compute positions for the two new layers.
(WebCore::ScrollingTreeScrollingNodeMac::setScrollLayerPosition):

Now use the static FrameView functions to compute the positions for these layers.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::frameViewDidChangeSize):
(WebCore::RenderLayerCompositor::positionForClipLayer):
(WebCore::RenderLayerCompositor::clipLayer):
(WebCore::RenderLayerCompositor::rootContentLayer):
(WebCore::RenderLayerCompositor::updateRootLayerPosition):
(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
(WebCore::RenderLayerCompositor::ensureRootLayer):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
* rendering/RenderLayerCompositor.h:

Source/WebKit2: 
Encode and decode the ScrollingStateScrollingNode’s m_topContentInset even though 
we don’t use it for anything yet. Since the headerLayer and footerLayer are not 
encoded or decoded yet, I did not encode/decode the insetClipLayer yet, which, 
like the header and footer layers, would not yet be used. 
* Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder<ScrollingStateScrollingNode>::encode):
(ArgumentCoder<ScrollingStateScrollingNode>::decode):

LayoutTests: 
Anchor point!

* compositing/absolute-inside-out-of-view-fixed-expected.txt:
* compositing/animation/filling-animation-overlap-at-end-expected.txt:
* compositing/animation/filling-animation-overlap-expected.txt:
* compositing/animation/layer-for-filling-animation-expected.txt:
* compositing/backing/backface-visibility-in-3dtransformed-expected.txt:
* compositing/backing/no-backing-for-clip-expected.txt:
* compositing/backing/no-backing-for-clip-overhang-expected.txt:
* compositing/backing/no-backing-for-clip-overlap-expected.txt:
* compositing/backing/no-backing-for-perspective-expected.txt:
* compositing/bounds-in-flipped-writing-mode-expected.txt:
* compositing/clip-child-by-non-stacking-ancestor-expected.txt:
* compositing/columns/ancestor-clipped-in-paginated-expected.txt:
* compositing/columns/clipped-in-paginated-expected.txt:
* compositing/columns/composited-columns-expected.txt:
* compositing/columns/composited-columns-vertical-rl-expected.txt:
* compositing/columns/composited-in-paginated-expected.txt:
* compositing/columns/composited-in-paginated-rl-expected.txt:
* compositing/columns/composited-in-paginated-writing-mode-rl-expected.txt:
* compositing/columns/composited-lr-paginated-repaint-expected.txt:
* compositing/columns/composited-nested-columns-expected.txt:
* compositing/columns/composited-rl-paginated-repaint-expected.txt:
* compositing/columns/hittest-composited-in-paginated-expected.txt:
* compositing/columns/rotated-in-paginated-expected.txt:
* compositing/columns/untransformed-composited-in-paginated-expected.txt:
* compositing/contents-opaque/background-clip-expected.txt:
* compositing/contents-opaque/background-color-expected.txt:
* compositing/contents-opaque/body-background-painted-expected.txt:
* compositing/contents-opaque/body-background-skipped-expected.txt:
* compositing/contents-opaque/filter-expected.txt:
* compositing/contents-opaque/hidden-with-visible-child-expected.txt:
* compositing/contents-opaque/hidden-with-visible-text-expected.txt:
* compositing/contents-opaque/layer-opacity-expected.txt:
* compositing/contents-opaque/layer-transform-expected.txt:
* compositing/contents-opaque/overflow-hidden-child-layers-expected.txt:
* compositing/contents-opaque/visibility-hidden-expected.txt:
* compositing/contents-scale/animating-expected.txt:
* compositing/contents-scale/rounded-contents-scale-expected.txt:
* compositing/contents-scale/scaled-ancestor-expected.txt:
* compositing/contents-scale/simple-scale-expected.txt:
* compositing/contents-scale/z-translate-expected.txt:
* compositing/filters/sw-layer-overlaps-hw-shadow-expected.txt:
* compositing/filters/sw-nested-shadow-overlaps-hw-nested-shadow-expected.txt:
* compositing/filters/sw-shadow-overlaps-hw-layer-expected.txt:
* compositing/filters/sw-shadow-overlaps-hw-shadow-expected.txt:
* compositing/geometry/ancestor-overflow-change-expected.txt:
* compositing/geometry/bounds-clipped-composited-child-expected.txt:
* compositing/geometry/bounds-ignores-hidden-composited-descendant-expected.txt:
* compositing/geometry/bounds-ignores-hidden-dynamic-expected.txt:
* compositing/geometry/bounds-ignores-hidden-dynamic-negzindex-expected.txt:
* compositing/geometry/bounds-ignores-hidden-expected.txt:
* compositing/geometry/clip-expected.txt:
* compositing/geometry/clip-inside-expected.txt:
* compositing/geometry/composited-in-columns-expected.txt:
* compositing/geometry/fixed-position-flipped-writing-mode-expected.txt:
* compositing/geometry/flipped-writing-mode-expected.txt:
* compositing/geometry/foreground-layer-expected.txt:
* compositing/geometry/layer-due-to-layer-children-deep-switch-expected.txt:
* compositing/geometry/layer-due-to-layer-children-switch-expected.txt:
* compositing/geometry/limit-layer-bounds-clipping-ancestor-expected.txt:
* compositing/geometry/limit-layer-bounds-fixed-expected.txt:
* compositing/geometry/limit-layer-bounds-fixed-positioned-expected.txt:
* compositing/geometry/limit-layer-bounds-opacity-transition-expected.txt:
* compositing/geometry/limit-layer-bounds-overflow-root-expected.txt:
* compositing/geometry/limit-layer-bounds-positioned-expected.txt:
* compositing/geometry/limit-layer-bounds-positioned-transition-expected.txt:
* compositing/geometry/limit-layer-bounds-transformed-expected.txt:
* compositing/geometry/limit-layer-bounds-transformed-overflow-expected.txt:
* compositing/geometry/negative-text-indent-with-overflow-hidden-layer-expected.txt:
* compositing/geometry/preserve-3d-switching-expected.txt:
* compositing/iframes/become-composited-nested-iframes-expected.txt:
* compositing/iframes/become-overlapped-iframe-expected.txt:
* compositing/iframes/composited-parent-iframe-expected.txt:
* compositing/iframes/connect-compositing-iframe-delayed-expected.txt:
* compositing/iframes/connect-compositing-iframe-expected.txt:
* compositing/iframes/connect-compositing-iframe2-expected.txt:
* compositing/iframes/connect-compositing-iframe3-expected.txt:
* compositing/iframes/enter-compositing-iframe-expected.txt:
* compositing/iframes/iframe-resize-expected.txt:
* compositing/iframes/iframe-size-from-zero-expected.txt:
* compositing/iframes/invisible-nested-iframe-hide-expected.txt:
* compositing/iframes/overlapped-iframe-expected.txt:
* compositing/iframes/overlapped-iframe-iframe-expected.txt:
* compositing/iframes/overlapped-nested-iframes-expected.txt:
* compositing/iframes/page-cache-layer-tree-expected.txt:
* compositing/iframes/scrolling-iframe-expected.txt:
* compositing/images/clip-on-directly-composited-image-expected.txt:
* compositing/layer-creation/animation-overlap-with-children-expected.txt:
* compositing/layer-creation/fixed-position-and-transform-expected.txt:
* compositing/layer-creation/fixed-position-change-out-of-view-in-view-expected.txt:
* compositing/layer-creation/fixed-position-out-of-view-expected.txt:
* compositing/layer-creation/fixed-position-out-of-view-scaled-expected.txt:
* compositing/layer-creation/fixed-position-out-of-view-scaled-scroll-expected.txt:
* compositing/layer-creation/fixed-position-transformed-into-view-expected.txt:
* compositing/layer-creation/fixed-position-under-transform-expected.txt:
* compositing/layer-creation/no-compositing-for-fixed-position-under-transform-expected.txt:
* compositing/layer-creation/no-compositing-for-preserve-3d-expected.txt:
* compositing/layer-creation/overflow-scroll-overlap-expected.txt:
* compositing/layer-creation/overlap-animation-clipping-expected.txt:
* compositing/layer-creation/overlap-animation-expected.txt:
* compositing/layer-creation/overlap-child-layer-expected.txt:
* compositing/layer-creation/overlap-clipping-expected.txt:
* compositing/layer-creation/overlap-transformed-3d-expected.txt:
* compositing/layer-creation/overlap-transformed-and-clipped-expected.txt:
* compositing/layer-creation/overlap-transformed-layer-expected.txt:
* compositing/layer-creation/overlap-transformed-preserved-3d-expected.txt:
* compositing/layer-creation/overlap-transforms-expected.txt:
* compositing/layer-creation/rotate3d-overlap-expected.txt:
* compositing/layer-creation/scroll-partial-update-expected.txt:
* compositing/layer-creation/spanOverlapsCanvas-expected.txt:
* compositing/layer-creation/stacking-context-overlap-expected.txt:
* compositing/layer-creation/stacking-context-overlap-nested-expected.txt:
* compositing/layer-creation/translatez-overlap-expected.txt:
* compositing/masks/mask-layer-size-expected.txt:
* compositing/overflow-trumps-transform-style-expected.txt:
* compositing/overflow/clip-descendents-expected.txt:
* compositing/overflow/content-gains-scrollbars-expected.txt:
* compositing/overflow/content-loses-scrollbars-expected.txt:
* compositing/overflow/overflow-scrollbar-layer-positions-expected.txt:
* compositing/overflow/overflow-scrollbar-layers-expected.txt:
* compositing/overflow/resize-painting-expected.txt:
* compositing/plugins/no-backing-store-expected.txt:
* compositing/plugins/small-to-large-composited-plugin-expected.txt:
* compositing/regions/fixed-in-named-flow-clip-descendant-expected.txt:
* compositing/regions/fixed-in-named-flow-expected.txt:
* compositing/regions/fixed-in-named-flow-from-abs-in-named-flow-expected.txt:
* compositing/regions/fixed-in-named-flow-from-outflow-expected.txt:
* compositing/regions/fixed-in-named-flow-got-transformed-parent-expected.txt:
* compositing/regions/fixed-in-named-flow-lost-transformed-parent-expected.txt:
* compositing/regions/fixed-in-named-flow-overlap-composited-expected.txt:
* compositing/regions/fixed-in-named-flow-transformed-parent-expected.txt:
* compositing/regions/fixed-transformed-in-named-flow-expected.txt:
* compositing/repaint/absolute-painted-into-composited-ancestor-expected.txt:
* compositing/repaint/fixed-background-scroll-expected.txt:
* compositing/repaint/positioned-movement-expected.txt:
* compositing/repaint/repaint-on-layer-grouping-change-expected.txt:
* compositing/repaint/resize-repaint-expected.txt:
* compositing/rtl/rtl-absolute-expected.txt:
* compositing/rtl/rtl-absolute-overflow-expected.txt:
* compositing/rtl/rtl-absolute-overflow-scrolled-expected.txt:
* compositing/rtl/rtl-fixed-expected.txt:
* compositing/rtl/rtl-fixed-overflow-expected.txt:
* compositing/rtl/rtl-fixed-overflow-scrolled-expected.txt:
* compositing/rtl/rtl-relative-expected.txt:
* compositing/tiled-layers-hidpi-expected.txt:
* compositing/visibility/layer-visible-content-expected.txt:
* platform/mac-wk2/compositing/contents-opaque/body-background-painted-expected.txt:
* platform/mac-wk2/compositing/contents-opaque/body-background-skipped-expected.txt:
* platform/mac-wk2/compositing/repaint/fixed-background-scroll-expected.txt:
* platform/mac-wk2/compositing/rtl/rtl-absolute-expected.txt:
* platform/mac-wk2/compositing/rtl/rtl-absolute-overflow-expected.txt:
* platform/mac-wk2/compositing/rtl/rtl-absolute-overflow-scrolled-expected.txt:
* platform/mac-wk2/compositing/rtl/rtl-fixed-expected.txt:
* platform/mac-wk2/compositing/rtl/rtl-fixed-overflow-expected.txt:
* platform/mac-wk2/compositing/tiling/rotated-tiled-clamped-expected.txt:
* platform/mac-wk2/compositing/tiling/rotated-tiled-preserve3d-clamped-expected.txt:
* platform/mac-wk2/compositing/tiling/tile-cache-zoomed-expected.txt:
* platform/mac-wk2/compositing/tiling/tiled-layer-resize-expected.txt:
* platform/mac-wk2/compositing/visible-rect/iframe-no-layers-expected.txt:
* platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div-expected.txt:
* platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div-with-handler-expected.txt:
* platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-mainframe-expected.txt:
* platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-mainframe-with-handler-expected.txt:
* platform/mac-wk2/tiled-drawing/fast-scroll-iframe-latched-iframe-expected.txt:
* platform/mac-wk2/tiled-drawing/fast-scroll-iframe-latched-iframe-with-handler-expected.txt:
* platform/mac-wk2/tiled-drawing/fast-scroll-iframe-latched-mainframe-expected.txt:
* platform/mac-wk2/tiled-drawing/fast-scroll-iframe-latched-mainframe-with-handler-expected.txt:
* platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-mainframe-expected.txt:
* platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-mainframe-with-handler-expected.txt:
* platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select-expected.txt:
* platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select-with-handler-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed-background/fixed-background-no-image-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-body-layer-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-opacity-html-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-positioned-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-transformed-html-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-zoomed-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed-background/fixed-html-background-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed-background/fixed-non-propagated-body-background-expected.txt:
* platform/mac-wk2/tiled-drawing/simple-document-with-margin-tiles-expected.txt:
* platform/mac-wk2/tiled-drawing/sticky/sticky-layers-expected.txt:
* platform/mac-wk2/tiled-drawing/tile-coverage-after-scroll-expected.txt:
* platform/mac-wk2/tiled-drawing/tile-coverage-after-scroll-speculative-expected.txt:
* platform/mac-wk2/tiled-drawing/tile-coverage-scroll-to-bottom-expected.txt:
* platform/mac-wk2/tiled-drawing/tile-coverage-slow-scrolling-expected.txt:
* platform/mac-wk2/tiled-drawing/tile-coverage-speculative-expected.txt:
* platform/mac-wk2/tiled-drawing/tile-size-slow-zoomed-expected.txt:
* platform/mac-wk2/tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration-expected.txt:
* platform/mac-wk2/tiled-drawing/tiled-drawing-zoom-expected.txt:
* platform/mac-wk2/tiled-drawing/tiled-drawing-zoom-scrolled-expected.txt:
* platform/mac-wk2/tiled-drawing/use-tiled-drawing-expected.txt:
* platform/mac/compositing/canvas/accelerated-canvas-compositing-expected.txt:
* platform/mac/compositing/geometry/fixed-position-composited-switch-expected.txt:
* platform/mac/compositing/iframes/invisible-nested-iframe-show-expected.txt:
* platform/mac/compositing/iframes/resizer-expected.txt:
* platform/mac/compositing/images/direct-image-object-fit-expected.txt:
* platform/mac/compositing/layer-creation/overlap-animation-container-expected.txt:
* platform/mac/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants-expected.txt:
* platform/mac/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants2-expected.txt:
* platform/mac/compositing/overflow/composited-scrolling-creates-a-stacking-container-expected.txt:
* platform/mac/compositing/overflow/composited-scrolling-paint-phases-expected.txt:
* platform/mac/compositing/reflections/direct-image-object-fit-reflected-expected.txt:
* platform/mac/compositing/repaint/invalidations-on-composited-layers-expected.txt:
* platform/mac/compositing/tiling/backface-preserve-3d-tiled-expected.txt:
* platform/mac/compositing/tiling/crash-reparent-tiled-layer-expected.txt:
* platform/mac/compositing/tiling/huge-layer-add-remove-child-expected.txt:
* platform/mac/compositing/tiling/huge-layer-img-expected.txt:
* platform/mac/compositing/tiling/huge-layer-with-layer-children-expected.txt:
* platform/mac/compositing/tiling/huge-layer-with-layer-children-resize-expected.txt:
* platform/mac/compositing/tiling/rotated-tiled-clamped-expected.txt:
* platform/mac/compositing/tiling/rotated-tiled-preserve3d-clamped-expected.txt:
* platform/mac/compositing/tiling/tile-cache-zoomed-expected.txt:
* platform/mac/compositing/tiling/tiled-layer-resize-expected.txt:
* platform/mac/compositing/video/video-object-fit-expected.txt:
* platform/mac/compositing/visible-rect/2d-transformed-expected.txt:
* platform/mac/compositing/visible-rect/3d-transform-style-expected.txt:
* platform/mac/compositing/visible-rect/3d-transformed-expected.txt:
* platform/mac/compositing/visible-rect/animated-expected.txt:
* platform/mac/compositing/visible-rect/animated-from-none-expected.txt:
* platform/mac/compositing/visible-rect/clipped-by-viewport-expected.txt:
* platform/mac/compositing/visible-rect/clipped-visible-rect-expected.txt:
* platform/mac/compositing/visible-rect/flipped-preserve-3d-expected.txt:
* platform/mac/compositing/visible-rect/iframe-and-layers-expected.txt:
* platform/mac/compositing/visible-rect/iframe-no-layers-expected.txt:
* platform/mac/compositing/visible-rect/nested-transform-expected.txt:
* platform/mac/compositing/visible-rect/scrolled-expected.txt:



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