Build fix after r166307.

Not reviewed.

* runtime/JSCell.h:
- The inline function isAPIValueWrapper() should not be exported.  This
  was causing a linkage error when building for 32-bit x86 on Mac.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166330 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Assertion failure in RemoteLayerBackingStore::flush
https://bugs.webkit.org/show_bug.cgi?id=130810
<rdar://problem/16439276>

Reviewed by Simon Fraser.

* Shared/mac/RemoteLayerBackingStore.mm:
(RemoteLayerBackingStore::flush):
We don't always have backing store to flush, if platformCALayerDrawsContent() is false.
We also can't assert that we have a back surface, because the very first paint will not.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166331 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add -[WKWebView stopLoading]
https://bugs.webkit.org/show_bug.cgi?id=130812

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/WKWebView.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView stopLoading]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166332 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Hook up -webkit-overflow-scrolling:touch for iOS WK2
https://bugs.webkit.org/show_bug.cgi?id=130809

Reviewed by Tim Horton.

Source/WebCore:

Get -webkit-overflow-scrolling: touch working for iOS WK2.

* WebCore.exp.in:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::updateScrollingNode):
Send in ScrollingGeometry when we update scrolling nodes.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::updateScrollingNode):
* page/scrolling/ios/ScrollingTreeScrollingNodeIOS.h:
Need to get to the scrolling layer in a subclass.
(WebCore::ScrollingTreeScrollingNodeIOS::scrollLayer):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::hasAcceleratedTouchScrolling): Remove code
that temporarily disabled touch-scrolling.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): When we
update scrolling nodes, send in the right scrolling geometry.

Source/WebKit2:

* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren):
Set the content size of the UIScrollVIew based on the geometry.
* UIProcess/ios/RemoteLayerTreeHostIOS.mm:
(WebKit::RemoteLayerTreeHost::createLayer): Make a UIScrollView if the
layer properties tell us that we have the scrolling behavior.
* UIProcess/ios/WKContentView.mm:
(-[WKContentView initWithFrame:context:WebKit::configuration:WebKit::webView:]):
We need to allow user interaction in the _rootContentView so that events get to
nested UIScrollViews (this could be optimized in future).
* UIProcess/mac/RemoteLayerTreeHost.h:
* UIProcess/mac/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::updateLayerTree):
(WebKit::RemoteLayerTreeHost::createLayer): Need to pass RemoteLayerTreeTransaction::LayerProperties
in so we can get at the custom behavior.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166333 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix the build: include UIKit headers inside the iOS #ifdef.

* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166334 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Convert more of HTMLConverter to C++
https://bugs.webkit.org/show_bug.cgi?id=130811

Reviewed by Anders Carlsson.

* editing/cocoa/HTMLConverter.mm:
(HTMLConverter::HTMLConverter):
(HTMLConverter::~HTMLConverter):
(HTMLConverter::_blockLevelElementForNode):
(HTMLConverter::_colorForElement):
(HTMLConverter::_computedAttributesForElement):
(HTMLConverter::_attributesForElement):
(HTMLConverter::_fillInBlock):
(HTMLConverter::_enterElement):
(HTMLConverter::_addTableForElement):
(HTMLConverter::_addTableCellForElement):
(HTMLConverter::_processElement):
(HTMLConverter::_exitElement):
(HTMLConverter::_getFloat): Deleted.
(HTMLConverter::_elementIsBlockLevel): Deleted.
(HTMLConverter::_elementHasOwnBackgroundColor): Deleted.
(HTMLConverter::_colorForNode): Deleted.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166335 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS WebKit2] Crashes on swipe
<rdar://problem/16440867>

Reviewed by Benjamin Poulain.

* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::beginSwipeGesture):
Get the IOSurfaceRef from the WebCore::IOSurface.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166336 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Replay: disable page cache during capture/replay
https://bugs.webkit.org/show_bug.cgi?id=130672

Reviewed by Timothy Hatcher.

Save, set, and restore page cache settings at the correct times.

No new tests. If this code fails, then the tests for network replay will fail.

* replay/ReplayController.cpp:
(WebCore::ReplayController::setForceDeterministicSettings): Added.
(WebCore::ReplayController::startCapturing):
(WebCore::ReplayController::stopCapturing):
(WebCore::ReplayController::cancelPlayback):
(WebCore::ReplayController::replayToPosition):
* replay/ReplayController.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166337 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rename a delegate method to -webView:didFinishNavigation:
https://bugs.webkit.org/show_bug.cgi?id=130814

Reviewed by Sam Weinig.

* UIProcess/API/Cocoa/WKNavigationDelegate.h:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate):
(WebKit::NavigationState::LoaderClient::didFinishLoadForFrame):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166338 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make sure childContainmentLayer is parented
https://bugs.webkit.org/show_bug.cgi?id=130808

Reviewed by Tim Horton.

m_childContainmentLayer was never parented if the page
created no other compositing layers, which left a dangling
GraphicsLayer which in turn confused UI-side compositing a little.
Fix by always parenting this layer.

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166339 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a _WKScriptWorld class
https://bugs.webkit.org/show_bug.cgi?id=130817

Reviewed by Dan Bernstein.

* UIProcess/API/Cocoa/_WKScriptWorld.h: Added.
* UIProcess/API/Cocoa/_WKScriptWorld.mm: Added.
(generateWorldID):
(+[_WKScriptWorld defaultWorld]):
(-[_WKScriptWorld init]):
(-[_WKScriptWorld _initWithWorldID:]):
* WebKit2.xcodeproj/project.pbxproj:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166340 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FEGaussianBlur: unify and const-ify calculateKernelSize
https://bugs.webkit.org/show_bug.cgi?id=130779

Some methods can benefit of using const refs as also make sense to
unify the interface (i.e. parameters) in calculateKernelSize/Unscaled.

FilterEffect::filter() will now return a reference, which helps since
its descendants were accessing methods into the pointer without testing
for it.

Reviewed by Simon Fraser.

No new tests, no changes on behavior.

* platform/graphics/filters/FEDisplacementMap.cpp:
(WebCore::FEDisplacementMap::platformApplySoftware):
* platform/graphics/filters/FEDropShadow.cpp:
(WebCore::FEDropShadow::determineAbsolutePaintRect):
(WebCore::FEDropShadow::platformApplySoftware):
* platform/graphics/filters/FEGaussianBlur.cpp:
(WebCore::FEGaussianBlur::calculateUnscaledKernelSize):
(WebCore::FEGaussianBlur::calculateKernelSize):
(WebCore::FEGaussianBlur::determineAbsolutePaintRect):
(WebCore::FEGaussianBlur::platformApplySoftware):
* platform/graphics/filters/FEGaussianBlur.h:
* platform/graphics/filters/FEMorphology.cpp:
(WebCore::FEMorphology::determineAbsolutePaintRect):
(WebCore::FEMorphology::platformApplySoftware):
* platform/graphics/filters/FEOffset.cpp:
(WebCore::FEOffset::determineAbsolutePaintRect):
(WebCore::FEOffset::platformApplySoftware):
* platform/graphics/filters/FETile.cpp:
(WebCore::FETile::platformApplySoftware):
* platform/graphics/filters/FETurbulence.cpp:
(WebCore::FETurbulence::fillRegion):
* platform/graphics/filters/Filter.h:
(WebCore::Filter::applyHorizontalScale):
(WebCore::Filter::applyVerticalScale):
* platform/graphics/filters/FilterEffect.h:
(WebCore::FilterEffect::filter):
* platform/graphics/filters/SourceAlpha.cpp:
(WebCore::SourceAlpha::determineAbsolutePaintRect):
(WebCore::SourceAlpha::platformApplySoftware):
* platform/graphics/filters/SourceGraphic.cpp:
(WebCore::SourceGraphic::determineAbsolutePaintRect):
(WebCore::SourceGraphic::platformApplySoftware):
* rendering/svg/RenderSVGResourceFilterPrimitive.cpp:
(WebCore::RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion):
* svg/graphics/filters/SVGFEImage.cpp:
(WebCore::FEImage::determineAbsolutePaintRect):
(WebCore::FEImage::platformApplySoftware):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166341 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make _processText and _traverseNode in HTMLConverter more efficient
https://bugs.webkit.org/show_bug.cgi?id=130769

Reviewed by Sam Weinig.

Rewrote a bunch of code in C++ and avoided creating wrappers.
This reduces the runtime of Interactive/CopyAll.html from ~16.5s to 15s.

* editing/cocoa/HTMLConverter.mm:
(HTMLConverterCaches::isAncestorsOfStartToBeConverted):
(HTMLConverter::HTMLConverter):
(HTMLConverter::~HTMLConverter):
(HTMLConverter::_processElement):
(HTMLConverter::_processText):
(HTMLConverter::_traverseNode):
(HTMLConverter::_traverseFooterNode):
(HTMLConverterCaches::cacheAncestorsOfStartToBeConverted):
(HTMLConverter::_loadFromDOMRange):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166342 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS][WK2] <rdar://problem/16265272> REGRESSION (WebKit2): Some pages appear blank until you scroll
https://bugs.webkit.org/show_bug.cgi?id=130819

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-03-26
Reviewed by Tim Horton.

When loading a new page, we never define the unobscured rect and exposed rect on the new frame.
As a result, there is nothing to render.

It uses to work thanks to dumb luck and a bug in Safari updating the visibleContentRects from
the UIProcess. Now that the bug is gone, "dumb luck" is not reliable enough to get the content rects :)

What this patch does is save if we have ever received new rects from the UI. If we have not, create them
based on the minimum layout size. This works because we know Safari shows the minimum layout size by default
and will tell us if it changes the obscured rects.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
(WebKit::WebPage::didCommitLoad):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::viewportConfigurationChanged):
(WebKit::WebPage::updateVisibleContentRects):


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

* editing/cocoa/HTMLConverter.mm:
(_font):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166344 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Parse stackmaps liveOuts
https://bugs.webkit.org/show_bug.cgi?id=130801

Reviewed by Geoffrey Garen.
        
This just adds the code to parse them but doesn't do anything with them, yet.

* ftl/FTLLocation.cpp:
(JSC::FTL::Location::forStackmaps):
* ftl/FTLLocation.h:
(JSC::FTL::Location::forRegister):
(JSC::FTL::Location::forIndirect):
* ftl/FTLStackMaps.cpp:
(JSC::FTL::StackMaps::Location::parse):
(JSC::FTL::StackMaps::Location::dump):
(JSC::FTL::StackMaps::LiveOut::parse):
(JSC::FTL::StackMaps::LiveOut::dump):
(JSC::FTL::StackMaps::Record::parse):
(JSC::FTL::StackMaps::Record::dump):
* ftl/FTLStackMaps.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166345 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Blind speculative iOS build fix.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::viewportConfigurationChanged):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166346 268f45cc-cd09-0410-ab3c-d52691b4dbfc
HTMLConverter::_processText is slow because it walks up ancestor elements
https://bugs.webkit.org/show_bug.cgi?id=130820

Reviewed by Sam Weinig.

Avoid walking up the tree from each text node by caching the aggregated attributed strings for each element.
Also compute the attributed strings top-down to avoid calling mutableCopy in every iteration.

This reduces the runtime of Interactive/CopyAll.html from 15s to 13s (15%).

* editing/cocoa/HTMLConverter.mm:
(HTMLConverter::_attributesForElement):
(HTMLConverter::attributesForElement):
(HTMLConverter::aggregatedAttributesForAncestors):
(HTMLConverter::_processText):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166347 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix failing scrolling tests by reverting to previous behavior where
the scrolling geometry for the main frame scrolling node was only
updated from frameViewLayoutUpdated() and no-where else.

* WebCore.exp.in:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::updateScrollingNode):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::updateScrollingNode):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
(WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer): Deleted.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166348 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r166296 and r166331.
https://bugs.webkit.org/show_bug.cgi?id=130822

caused some crashes and frequent assertion failures, and the
fix is going to take a little while (Requested by thorton on
#webkit).

Reverted changesets:

"[iOS WebKit2] Flush all surfaces after painting into all of
them, instead of after painting into each one"
https://bugs.webkit.org/show_bug.cgi?id=130768
http://trac.webkit.org/changeset/166296

Source/WebCore:

"Assertion failure in RemoteLayerBackingStore::flush"
https://bugs.webkit.org/show_bug.cgi?id=130810
http://trac.webkit.org/changeset/166331

Source/WebKit2:

"Assertion failure in RemoteLayerBackingStore::flush"
https://bugs.webkit.org/show_bug.cgi?id=130810
http://trac.webkit.org/changeset/166331

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