Maximum scroll position can be negative in some cases
https://bugs.webkit.org/show_bug.cgi?id=118175
<rdar://problem/14301217>

Reviewed by Anders Carlsson.

Test (API): WebKit2.ResizeReversePaginatedWebView

* page/FrameView.cpp:
(WebCore::FrameView::maximumScrollPosition):
* page/FrameView.h:
Override maximumScrollPosition() in FrameView and don't clamp to zero if
a reverse pagination mode is enabled, as it is possible (and common) to
have a negative maximum scroll position with reverse pagination.

* platform/ScrollView.cpp:
(WebCore::ScrollView::updateScrollbars):
Drive-by adoption of toIntSize().

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/ResizeReversePaginatedWebView.cpp: Added.
(TestWebKitAPI::didRunJavaScript):
(TestWebKitAPI::didLayout):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2/lots-of-text-vertical-lr.html: Added.
Add a test that loads a vertical-lr document, paginates it horizontally
from right to left, resizes the view to fit the entire document, and
verifies that the scroll position is negative, as it must be for the
document to be enclosed by the view.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152265 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[wk2] TiledCoreAnimationDrawingArea should support scrolling its exposed rect
https://bugs.webkit.org/show_bug.cgi?id=118173
<rdar://problem/14301166>

Reviewed by Anders Carlsson.

Offset the exposed rect passed from the WKView by the main frame's current scroll position
before sending it to our TiledBackings, so that it is in the same coordinate space as their
ordinary visibleRects.

This has the side effect of making clips-to-exposed-rect testable (though useless) in Safari.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
Add updateScrolledExposedRect() and m_scrolledExposedRect.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::scroll):
Call updateScrolledExposedRect when the main frame scrolls.

(WebKit::TiledCoreAnimationDrawingArea::setExposedRect):
Remove a FIXME about this change.
Call updateScrolledExposedRect instead of passing down the unscrolled rect.

(WebKit::TiledCoreAnimationDrawingArea::setClipsToExposedRect):
Call updateScrolledExposedRect, because that method will short-circuit if
setClipsToExposedRect is false, so we need to update here for correctness
if we get a setExposedRect(), setClipsToExposedRect(true) pair.

(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Update m_scrolledExposedRect and propagate it to our TiledBackings.

(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
(WebKit::TiledCoreAnimationDrawingArea::createPageOverlayLayer):
(WebKit::TiledCoreAnimationDrawingArea::didCommitChangesForLayer):
Use the scrolled exposed rect.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152266 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Link to WebInspectorUI.framework at build time instead of soft linking.

https://bugs.webkit.org/show_bug.cgi?id=118261

Reviewed by Joseph Pecoraro.

.:

* Source/Makefile: Build WebInspectorUI before WebKit and WebKit2.

Source/WebKit:

* WebKit.xcodeproj/project.pbxproj:

Source/WebKit/mac:

* Configurations/WebKit.xcconfig:
* WebCoreSupport/WebInspectorClient.mm:
(useWebKitWebInspector):

Source/WebKit2:

* Configurations/WebKit2.xcconfig:
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::inspectorReallyUsesWebKitUserInterface):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebPage/mac/WebInspectorMac.mm:
(WebKit::inspectorReallyUsesWebKitUserInterface):

Tools:

* Scripts/build-webkit: Build WebInspectorUI before WebKit and WebKit2.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152267 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fixed unreachable return when GLX or EGL are used with WebGL.
https://bugs.webkit.org/show_bug.cgi?id=118263

Reviewed by Noam Rosenthal.

* platform/graphics/opengl/GLPlatformContext.cpp:
(WebCore::createOffScreenContext): Fixed unreachable return.


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