Repeating background images should continue into margin tiles
https://bugs.webkit.org/show_bug.cgi?id=127021
-and corresponding-
<rdar://problem/15571300>

Reviewed by Simon Fraser.

This patch makes repeating background images continue into margin tiles. 

RenderObject::repaintRectangle() now takes an addition bool parameter which 
indicates whether or not the repaint rect should be clipped to the layer size.
* WebCore.exp.in:

These new functions on FrameView provide a way for code in the render tree to know 
if the TiledBacking has a margin. tiledBacking() is now const. It should have 
always been const, and it needs to be const to make these new functions const.
* page/FrameView.cpp:
(WebCore::FrameView::tiledBacking):
(WebCore::FrameView::hasExtendedBackground):
(WebCore::FrameView::extendedBackgroundRect):
* page/FrameView.h:
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::tiledBacking):

If we’re painting the root background and it is an extended background, we need to 
inflate the repaint rect to span the extended background. 
* rendering/RenderBox.cpp:
(WebCore::RenderBox::repaintLayerRectsForImage):

To get the phase right on repeated background images on a page with margin tiles, 
we need to make sure we factor the size of the margin tiles into the left and top 
values that we use when calculating background image geometry.
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):

setBackingNeedsRepaintInRect() now takes GraphicsLayer::ShouldClipToLayer as a 
parameter, just like setBackingNeedsRepaint(). 
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):

setContentsNeedDisplayInRect() also takes a GraphicsLayer::ShouldClipToLayer now, 
and it passes that information down to the GraphicsLayer.
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
* rendering/RenderLayerBacking.h:

These two RenderObject functions now take an optional bool parameter which 
indicates whether or not the rect should be clipped to the layer size. They use a 
bool instead of the GraphicsLayer enum in order to avoid including GraphicsLayer.h 
from within RenderObject.h. This seems like a simpler solution than adding a new 
stand-alone file for this very simple enum.
* rendering/RenderObject.cpp:
(WebCore::RenderObject::repaintUsingContainer):
(WebCore::RenderObject::repaintRectangle):
* rendering/RenderObject.h:

RenderView::backgroundRect needs to return the extendedBackgroundRect when it had 
one.
* rendering/RenderView.cpp:
(WebCore::RenderView::backgroundRect):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162098 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove unnecessary call to webGLContextCreated
https://bugs.webkit.org/show_bug.cgi?id=127000

Reviewed by Brent Fulgham.

Source/WebCore:

Note that the functionality of webGLContextCreated will be handled by webGLPolicyForSite now.

Tests: Unskipping tests skipped in r162002.

* html/HTMLCanvasElement.cpp: Remove webGLContextCreated call.
(WebCore::HTMLCanvasElement::getContext):
* loader/FrameLoaderClient.h:
Have the returned load policy default to WebGLAllow so as to not break clients that don't implement the method.
(WebCore::FrameLoaderClient::webGLPolicyForSite):
webGLPolicyForSite is now assuming the role of webGLContextCreated as well, pass in the whole site URL instead of just the host.
* page/ChromeClient.h: Remove webGLContextCreated method.
(WebCore::ChromeClient::decrementActivePageCount):

LayoutTests:

* platform/mac/TestExpectations: Unskipping tests skipped in r162002.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162099 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=127066
Add WKBrowsingContextHandle.h to WebKit2 private headers.

Patch by Yongjun Zhang <yongjun_zhang@apple.com> on 2014-01-15
Reviewed by Dan Bernstein.

Add WKBrowsingContextHandle.h to WebKit2 private headers so that WebKit2 client
can use WKBrowsingContextHandle class.

* WebKit2.xcodeproj/project.pbxproj:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162100 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Support WebSelections in WK2 on iOS.
https://bugs.webkit.org/show_bug.cgi?id=127015

Reviewed by Benjamin Poulain.

This is the first step towards adding support for selections in
non editable content on iOS for WK2.
In particular, this patch adds the basic plumbing to decide which
gesture recognizers are enabled and adds empty stubs for the gestures
that we'll need to support.
There are two separate assistants for selections, one to be used
in editable text (UIWKTextInteractionAssistant) and one for non editable
text (UIWKSelectionAssistant) and they are mutually exclusive.
UIWKSelectionAssistant is created at the time the view is created, 
and swapped with UIWKTextInteraction assistant
only when an editable element is focused and the keyboard appears on screen.

gestureRecognizerShouldBegin is the delegate call used to decide which gestures
should begin based on the position the gesture occurred at.
We want to avoid as much as possible synchronous calls to the WebProcess to
retrieve information about the content and in order to do so, we take advantage
of the order in which the gesture recognizers will trigger, based on the delay
configured at initialization.
The first gesture to trigger is highlightLongPress, followed by longpress in the
active assistant and longpress in the WKInteractionView.
There are two different scenarios for highlighlongpress based on which assistant is
currently active.

UIWKSelectionAssistant is active:
    We send a request to the WebProcess to get information on the position
    and we return YES, allowing the gesture to start.
    We delegate to the WebProcess the proper handling of highlight based on the element.
    When longPress gesture fires for the assistant, we assume we have received the reply to our
    previous request, if not we fetch the information synchronously.
    We are then able to make an informed decision about whether
    or not to start the gesture. If the reply is NO, the third and last long press
    gesture can be evaluated to decide whether to show the action sheet or simply generate
    a click event.

UIWKTextInteractionAssistant is active:
    In this case we must have information about the position immediately and we issue
    a synchronous request to the WebProcess.
    If we are not interacting with the same node, we return NO.
    Then the longpress gesture fires for the assistant which performs the same check.
    If the node is the same, the loupe gesture will start, otherwise the last longpress
    gesture will be evaluated to decide about showing the action sheet or generating a
    click event.

* Scripts/webkit2/messages.py:
* Shared/InteractionInformationAtPosition.cpp: Added.
(WebKit::InteractionInformationAtPosition::encode):
(WebKit::InteractionInformationAtPosition::decode):
* Shared/InteractionInformationAtPosition.h: Added.
(WebKit::InteractionInformationAtPosition::InteractionInformationAtPosition):
* UIProcess/API/ios/PageClientImplIOS.h:
* UIProcess/API/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::positionInformationDidChange):
* UIProcess/API/ios/WKContentView.mm:
(-[WKContentView _positionInformationDidChange:]):
* UIProcess/API/ios/WKContentViewInternal.h:
* UIProcess/API/ios/WKInteractionView.h:
* UIProcess/API/ios/WKInteractionView.mm:
(-[WKInteractionView initWithFrame:]):
(-[WKInteractionView dealloc]):
(-[WKInteractionView gestureRecognizer:canPreventGestureRecognizer:]):
(-[WKInteractionView gestureRecognizer:canBePreventedByGestureRecognizer:]):
(isSamePair):
(-[WKInteractionView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
(-[WKInteractionView _showImageSheet]):
(-[WKInteractionView _showLinkSheet]):
(-[WKInteractionView _actionForLongPress]):
(-[WKInteractionView ensurePositionInformationIsUpToDate:]):
(-[WKInteractionView gestureRecognizerShouldBegin:]):
(-[WKInteractionView hasSelectablePositionAtPoint:]):
(-[WKInteractionView pointIsInAssistedNode:]):
(-[WKInteractionView _longPressRecognized:]):
(-[WKInteractionView _doubleTapRecognized:]):
(-[WKInteractionView _twoFingerDoubleTapRecognized:]):
(-[WKInteractionView _twoFingerPanRecognized:]):
(-[WKInteractionView useSelectionAssistantWithMode:]):
(-[WKInteractionView _positionInformationDidChange:]):
(-[WKInteractionView interactionAssistant]):
(-[WKInteractionView _startAssistingKeyboard]):
(-[WKInteractionView _stopAssistingKeyboard]):
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::didReceivePositionInformation):
(WebKit::WebPageProxy::getPositionInformation):
(WebKit::WebPageProxy::requestPositionInformation):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::selectWithGesture):
(WebKit::WebPage::getPositionInformation):
(WebKit::WebPage::requestPositionInformation):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162103 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Properly exclude the shim dylibs this time
https://bugs.webkit.org/show_bug.cgi?id=127075

Reviewed by Anders Carlsson.

BaseLegacyProcess.xcconfig was setting EXCLUDED_SOURCE_FILE_NAMES in
conflict with what I added in r161918, and I misspelled the setting
name in two instances. Fix these two bugs.

Also remove a vestigial OTHER_LDFLAGS from WebContentProcess.xcconfig
while we're here.

* Configurations/BaseLegacyProcess.xcconfig:
* Configurations/NetworkProcess.xcconfig:
* Configurations/PluginProcess.xcconfig:
* Configurations/WebContentProcess.xcconfig:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162104 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WebGL] Resizing and entering/exiting full screen draws garbage
https://bugs.webkit.org/show_bug.cgi?id=127077

Reviewed by Dean Jackson.

* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
(WebCore::GraphicsContext3D::reshapeFBOs): Simplified logic regarding FBO switching.
(WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary): Make sure a few things
are turned off that might affect blitting data from one FBO to another.
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::prepareTexture): Actually turn dithering off!
(WebCore::GraphicsContext3D::reshape): Mark the context as dirty when resizing so that
the GL view is redrawn during resizing events.


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