Rubber-banding in overflow:scroll regions does not work correctly with 
direction:rtl
https://bugs.webkit.org/show_bug.cgi?id=136176

Reviewed by Tim Horton.

Small cleanup.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::visibleContentRectInternal):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172965 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r172771): Amazon product page becomes unresponsive after swiping back to it
https://bugs.webkit.org/show_bug.cgi?id=136260
<rdar://problem/18107826>

Reviewed by Dan Bernstein.

Previously, when a swipe ended up performing a same-document navigation,
we would never get didFinishLoadForMainFrame nor didFirstVisuallyNonEmptyLayoutForMainFrame
nor would we even get didHitRenderTreeSizeThreshold in all cases, so we would never
remove the swipe snapshot. Previous implementations removed the snapshot on
didSameDocumentNavigation for the main frame if the navigation type was Replace or Pop,
so we will match that behavior.

Also, reinstate the watchdog that starts at swipe-end which would have prevented
this bug from forever breaking the view it was associated with.

Also, defend against removing the snapshot before the swipe has finished (before
we have even caused the navigation that we're watching for the effects of).

* UIProcess/API/mac/WKView.mm:
(-[WKView _didSameDocumentNavigationForMainFrame:]):
* UIProcess/API/mac/WKViewInternal.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::didSameDocumentNavigationForMainFrame):
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::didSameDocumentNavigationForMainFrame):
Plumb main-frame same-document navigation notification from WebPageProxy
to ViewGestureControllerMac via PageClient and WKView.

* UIProcess/mac/ViewGestureController.h:
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::ViewGestureController):
(WebKit::ViewGestureController::beginSwipeGesture):
(WebKit::ViewGestureController::endSwipeGesture):
Keep track of whether a swipe is currently occurring. We can't use
activeGestureType for this because the swipe currently remains the "active"
gesture until the snapshot is removed.

Reintroduce the old swipeWatchdogTimer (and rename the shorter timer that starts
when we get a visually non-empty layout) so that we will always remove the
snapshot after 5 seconds, even if we haven't committed the load.
This could lead to flashing back to the old content if we fail to get a single
byte for 5 seconds, but that is a rare case and should eventually get additional
special treatment (dropping the tiles until we do get content, or some such).

(WebKit::ViewGestureController::didHitRenderTreeSizeThreshold):
If a swipe is still in progress, we haven't done our navigation and thus
don't care about render tree size changes.

(WebKit::ViewGestureController::didFirstVisuallyNonEmptyLayoutForMainFrame):
If a swipe is still in progress, we haven't done our navigation and thus
don't care about layouts.

Stop the 5 second overall watchdog if we start the 3 second after-visuallyNonEmptyLayout
watchdog. This means that the snapshot could stay up for a maximum of 8 seconds
for a very, very slow load.

(WebKit::ViewGestureController::didFinishLoadForMainFrame):
If a swipe is still in progress, we haven't done our navigation and thus
don't care about loads that complete.

(WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
Remove the swipe snapshot after painting if we do replaceState or popState.

(WebKit::ViewGestureController::removeSwipeSnapshotAfterRepaint):
If a swipe is still in progress, we shouldn't remove the snapshot yet.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172966 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Only define WEBCORE_EXPORT when building DumpRenderTree for Windows and iOS

Rubber-stamped by Tim Horton.

The Windows and iOS ports are the only ports that make use of WebCore headers
in DumpRenderTree.

* DumpRenderTree/config.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172967 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crashes in hit testing under WebPage::determinePrimarySnapshottedPlugIn()
https://bugs.webkit.org/show_bug.cgi?id=136240
rdar://problem/17231462

Reviewed by Darin Adler.

determinePrimarySnapshottedPlugIn() does render tree hit testing, so needs
to ensure that layout is up-to-date.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::determinePrimarySnapshottedPlugIn):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172968 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Ensure that layout is up-to-date before hit testing
https://bugs.webkit.org/show_bug.cgi?id=136242
rdar://problem/17435564

Reviewed by Tim Horton.

Various code paths can call into RenderView::hitTest() but fail to
ensure that layout is up-to-date. This is a conservative change that
fixes the issue for callers of EventHandler::hitTestResultAtPoint(),
including WebPage::acceptsFirstMouse() and WebFrame::hitTest().

This change is not general enough that we can ASSERT(!needsLayout())
in RenderView::hitTest() yet.

* page/EventHandler.cpp:
(WebCore::EventHandler::hitTestResultAtPoint):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172969 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Subpixel layout: Remove float to LayoutUnit ceil/round function wrappers.
https://bugs.webkit.org/show_bug.cgi?id=136253

Reviewed by Simon Fraser.

These functions wrap LayoutUnit::fromFloatCeil/fromFloatRound() functions to ceil/round float to LayoutUnit.
Their usage is limited and can easily be confused with the snapping functions (snap to css/device pixels).

No change in functionality.

* platform/LayoutUnit.h:
(WebCore::roundedLayoutUnit): Deleted. : Callers use the more explicit LayoutUnit::fromFloatRound() function.
(WebCore::ceiledLayoutUnit): Deleted. : Callers use the more explicit LayoutUnit::fromFloatCeil() function.
* rendering/RenderBlock.cpp:
(WebCore::updatePreferredWidth):
(WebCore::RenderBlock::computeInlinePreferredLogicalWidths):
(WebCore::adjustFloatForSubPixelLayout): Deleted.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::positionLineBox):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::resolveFlexibleLengths):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::offsetForInFlowPositionedInline):
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::preferredContentLogicalWidth):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172970 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r172966) [GTK] Build broken.

Unreviewed build fix after r172966.

* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::didSameDocumentNavigationForMainFrame):
* UIProcess/API/gtk/PageClientImpl.h:

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