[EFL][WK2] Introduce a WebView class as counterpart for WKViewRef
https://bugs.webkit.org/show_bug.cgi?id=107931

Reviewed by Anders Carlsson.

Source/WebKit2:

This is just one step of the new plan for the EFL API.

The plan is to move the public EFL-like API on top of the shared
WK2 C API, plus a few EFL extensions (WKView class mostly).

The EFL-like API can be seen as a convenience API which ties
well into EFL and which makes it easy to add web experiences
to existing and new EFL applications. It provides a smart object
like API and a Evas_Object based view.

For more advanced use cases, such as browser and runtime, it is
possible to use the WK* C API, which is gives more flexibility
while being more low level.

The idea is that the WKView class will not depend on Evas_Object
and X11 (future plan) unlike the current EFL-like API. This should
make it possible to use it for cases where none of these are
available.

This patch introduces the WebView class which serves as our
counterpart for the WKView class, and adds a few needed methods.

The EwkView owns the WebView class (and will be constructing it
in the near future when the EwkView class has been changed to
handle all smart object related code)

The clean up of the smart object related code as the proper
construction of EwkView and WebView will be done in follow-up
patches.

* UIProcess/API/C/efl/WKAPICastEfl.h:
(WebKit):

    The WKView API is not based on WebView and not Evas_Object*

* UIProcess/API/C/efl/WKView.cpp:
(WKViewCreate):
(WKViewCreateWithFixedLayout):
(WKViewInitialize):
(WKViewGetPage):
(WKViewSetThemePath):
(WKViewSuspendActiveDOMObjectsAndAnimations):
(WKViewResumeActiveDOMObjectsAndAnimations):
(WKViewGetEvasObject):
(WKViewCreateSnapshot):

    Add a few new WKView EFL C methods, and update existing
    methods to reflect that the WKViewRef is now a WebView*

    The construction methods will be rewritten when the smart
    object construction has been solved.

* UIProcess/API/C/efl/WKView.h:
* UIProcess/efl/WebView.cpp: Added.
(WebKit):
(WebKit::WebView::WebView):
(WebKit::WebView::~WebView):
(WebKit::WebView::initialize):
(WebKit::WebView::setThemePath):
(WebKit::WebView::suspendActiveDOMObjectsAndAnimations):
(WebKit::WebView::resumeActiveDOMObjectsAndAnimations):
* UIProcess/efl/WebView.h: Added.
(WebKit):
(WebView):
(WebKit::WebView::pageRef):
(WebKit::WebView::evasObject):
(WebKit::WebView::page):
(WebKit::WebView::type):

    Add a new WebKit::WebView class for EFL.

* UIProcess/API/efl/EwkView.cpp:
(EwkView::EwkView):
(EwkView::~EwkView):
(EwkView::wkPage):
(EwkView::setThemePath):
(EwkView::createGLSurface):

    Base methods on C API instead of internal API as much
    as currently possible.

* UIProcess/API/efl/EwkView.h:
(WebKit):
(WebView):
(EwkView):
(EwkView::wkView):
(EwkView::page):
* UIProcess/API/efl/ewk_view.cpp:
(createEwkView):
(ewk_view_base_add):
(ewk_view_smart_add):

    Modify to return the EwkView class for now.

* UIProcess/API/efl/ewk_view_private.h:
* UIProcess/efl/WebInspectorProxyEfl.cpp:
(WebKit::WebInspectorProxy::platformCreateInspectorPage):

    Updated due to changed API.

Tools:

Change platformView to be a WKView and use WKViewGetEvasObject
for the places where an Evas_Object is needed.

Instead of extracting the Ecore_Evas* from the m_view we use
the m_window instead, which actually holds the it.

* TestWebKitAPI/PlatformWebView.h:
* TestWebKitAPI/efl/PlatformWebView.cpp:
(TestWebKitAPI::PlatformWebView::PlatformWebView):
(TestWebKitAPI::PlatformWebView::~PlatformWebView):
(TestWebKitAPI::PlatformWebView::resizeTo):
(TestWebKitAPI::PlatformWebView::page):
(TestWebKitAPI::PlatformWebView::simulateSpacebarKeyPress):
(TestWebKitAPI::PlatformWebView::simulateMouseMove):
(TestWebKitAPI::PlatformWebView::simulateRightClick):
* WebKitTestRunner/PlatformWebView.h:
* WebKitTestRunner/efl/EventSenderProxyEfl.cpp:
(WTR::EventSenderProxy::sendTouchEvent):
(WTR::EventSenderProxy::setTouchModifier):
* WebKitTestRunner/efl/PlatformWebViewEfl.cpp:
(WTR::PlatformWebView::PlatformWebView):
(WTR::PlatformWebView::~PlatformWebView):
(WTR::PlatformWebView::resizeTo):
(WTR::PlatformWebView::page):
(WTR::PlatformWebView::focus):
(WTR::PlatformWebView::windowFrame):
(WTR::PlatformWebView::setWindowFrame):
(WTR::PlatformWebView::windowSnapshotImage):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141836 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make moveCaretTowardsWindowPoint not snap to the beginning/end when moved above/below editable
https://bugs.webkit.org/show_bug.cgi?id=107850

Patch by Chris Hopman <cjhopman@chromium.org> on 2013-02-04
Reviewed by Ojan Vafai.

Source/WebCore:

On Android, EditingBehavior::shouldMoveCaret[...] controls the
behavior of insertion handles. This change adds a new Android specific
editing behavior type.

The new EditingBehavior is the same as EditingUnixBehavior except for
EditingBehavior::shouldMoveCaret[...]. This new behavior fixes
WebFrame::moveCaretTowardsWindowPoint to not span to the
beginning/end.

* editing/EditingBehavior.h:
(WebCore::EditingBehavior::shouldMoveCaretToHorizontalBoundaryWhenPastTopOrBottom):
(WebCore::EditingBehavior::shouldAllowSpellingSuggestionsWithoutSelection):
(WebCore::EditingBehavior::shouldNavigateBackOnBackspace):
* editing/EditingBehaviorTypes.h:
* page/Settings.cpp:
(WebCore):
(WebCore::editingBehaviorTypeForPlatform):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::setEditingBehavior):

Source/WebKit/chromium:

On Android, EditingBehavior::shouldMoveCaret[...] controls the
behavior of insertion handles. This change adds a new Android specific
editing behavior type so that we can change these settings independent
of behavior for other platforms.

* public/WebSettings.h:
* src/AssertMatchingEnums.cpp:
Just add the corresponding assertion for the new editing behavior.

* public/WebSettings.h:
* src/AssertMatchingEnums.cpp:

* tests/WebFrameTest.cpp:
* tests/data/move_caret.html: Added.
Add a test that moveCaretTowardsWindowPoint works as expected on
Android.

LayoutTests:

Test the new "android" editing behavior in the following tests:

* editing/deleting/delete-ligature-003-expected.txt:
* editing/deleting/delete-ligature-003.html:
* editing/deleting/paragraph-in-preserveNewline-expected.txt:
* editing/deleting/paragraph-in-preserveNewline.html:
* editing/deleting/whitespace-pre-1-expected.txt:
* editing/deleting/whitespace-pre-1.html:
* editing/execCommand/script-tests/toggle-compound-styles.js:
* editing/execCommand/toggle-compound-styles-expected.txt:
* editing/selection/5354455-1-expected.txt:
* editing/selection/5354455-1.html:
* editing/selection/click-in-margins-inside-editable-div-expected.txt:
* editing/selection/click-in-padding-with-multiple-line-boxes-expected.txt:
* editing/selection/context-menu-text-selection-expected.txt:
* editing/selection/context-menu-text-selection.html:
* editing/selection/extend-after-mouse-selection-expected.txt:
* editing/selection/extend-after-mouse-selection.html:
* editing/selection/programmatic-selection-on-mac-is-directionless-expected.txt:
* editing/selection/programmatic-selection-on-mac-is-directionless.html:
* editing/selection/rtl-move-selection-right-left-expected.txt:
* editing/selection/rtl-move-selection-right-left.html:
* editing/selection/script-tests/click-in-margins-inside-editable-div.js:
* editing/selection/script-tests/click-in-padding-with-multiple-line-boxes.js:
* editing/selection/selection-extend-should-not-move-across-caret-on-mac-expected.txt:
* editing/selection/selection-extend-should-not-move-across-caret-on-mac.html:

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