X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=Source%2FWebKit2%2FWebProcess%2FWebPage%2Fefl%2FWebPageEfl.cpp;h=37b51cdfef4eeb447336f60d23176c12d8ae0a4c;hb=abf5e0fb8b14485767ca015d4cd478408dc3f715;hp=6f4aeb65f8a4b6429ee068b1488c99699a232807;hpb=d605614fcb50027f56b82df5d96408ee4017a0ce;p=framework%2Fweb%2Fwebkit-efl.git diff --git a/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp b/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp old mode 100644 new mode 100755 index 6f4aeb6..37b51cd --- a/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp +++ b/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp @@ -139,6 +139,10 @@ #include "WebEventConversion.h" #endif +#if ENABLE(TIZEN_SCREEN_READER) || ENABLE(TIZEN_FOCUS_UI) || ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION) +#include +#endif + #if ENABLE(TIZEN_CSP) #include #endif @@ -151,6 +155,10 @@ #include "fontconfig/fontconfig.h" #include #endif + +#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION) +#include "visible_units.h" +#endif #endif // #if OS(TIZEN) using namespace WebCore; @@ -174,6 +182,9 @@ void WebPage::platformPreferencesDidChange(const WebPreferencesStore& store) #if ENABLE(TIZEN_LOAD_REMOTE_IMAGES) settings->setLoadRemoteImages(store.getBoolValueForKey(WebPreferencesKey::loadRemoteImagesKey())); #endif +#if ENABLE(TIZEN_LINK_EFFECT) + settings->setLinkEffectEnabled(store.getBoolValueForKey(WebPreferencesKey::linkEffectEnabledKey())); +#endif #if ENABLE(TIZEN_ISF_PORT) settings->setEnableDefaultKeypad(store.getBoolValueForKey(WebPreferencesKey::defaultKeypadEnabledKey())); #endif @@ -279,6 +290,13 @@ void WebPage::confirmComposition(const String& compositionString) if (!targetFrame) return; +#if ENABLE(TIZEN_ISF_PORT) + if (m_prepareKeyDownEvent) { + m_keyPressCommands.append(adoptPtr(new ConfirmCompositionKeyPressCommand(compositionString))); + return; + } +#endif + targetFrame->editor()->confirmComposition(compositionString); #if ENABLE(TIZEN_ISF_PORT) @@ -293,6 +311,14 @@ void WebPage::setComposition(const String& compositionString, const Vectoreditor()->hasComposition() && compositionString.isEmpty()) + return; + + if (m_prepareKeyDownEvent) { + m_keyPressCommands.append(adoptPtr(new SetCompositionKeyPressCommand(compositionString, underlines, cursorPosition))); + return; + } + if (targetFrame->selection()->rootEditableElement()) { HTMLTextFormControlElement* textFormControl = toTextFormControl(targetFrame->selection()->rootEditableElement()->shadowAncestorNode()); if (textFormControl && textFormControl->maxLength() >= 0) { @@ -565,6 +591,11 @@ bool WebPage::setCaretPosition(const IntPoint& pos) if (!node || !node->renderer()) return false; + Element* currentRootEditableElement = node->rootEditableElement(); + Element* newRootEditableElement = innerNode->rootEditableElement(); + if (currentRootEditableElement != newRootEditableElement) + return false; + IntRect rect = controller->caretRenderer()->absoluteBoundingBoxRect(true); // The below wirtten code is not correct way to implement. Presntly the is no @@ -650,6 +681,17 @@ void WebPage::didCancelComposition(Node* valueChangedNode) send(Messages::WebPageProxy::DidCancelComposition()); } +void WebPage::prepareKeyDownEvent() +{ + m_prepareKeyDownEvent = true; + m_keyPressCommands.clear(); +} + +void WebPage::swapKeyPressCommands(Vector >& commands) +{ + m_keyPressCommands.swap(commands); +} + void WebPage::getCursorOffset(int& offset) { offset = 0; @@ -705,6 +747,11 @@ void WebPage::deleteSurroundingText(int offset, int count) if (!frame || !frame->editor()->canEdit()) return; + if (m_prepareKeyDownEvent) { + m_keyPressCommands.append(adoptPtr(new DeleteTextKeyPressCommand(offset, count))); + return; + } + Position base(frame->selection()->base()); offset += base.offsetInContainerNode(); base.moveToOffset(offset); @@ -852,9 +899,22 @@ static IntRect getNodeRect(Node* node, Node* focusableNode, bool isImage) #if ENABLE(TIZEN_WEBKIT2_HIT_TEST) #if ENABLE(TIZEN_WEBKIT2_FOCUS_RING) +#if ENABLE(TOUCH_ADJUSTMENT) +static IntRect getFocusedRect(HitTestResult hitTestResult, Page* page, const IntPoint& point, const IntSize& area) +#else static IntRect getFocusedRect(HitTestResult hitTestResult, Page* page) +#endif { Node* node = hitTestResult.innerNode(); +#if ENABLE(TOUCH_ADJUSTMENT) + Node* adjustedNode = 0; + IntPoint adustedPoint; + Frame* mainFrame = page->mainFrame(); + mainFrame->eventHandler()->bestClickableNodeForTouchPoint(point, IntSize(area.width() / 2, area.height() / 2), adustedPoint, adjustedNode); + + if (adjustedNode) + node = adjustedNode; +#endif if (!node) return IntRect(); @@ -862,7 +922,7 @@ static IntRect getFocusedRect(HitTestResult hitTestResult, Page* page) Node* focusableNode = node; while (focusableNode) { RenderObject* renderer = focusableNode->renderer(); - if (renderer && renderer->isRoot()) + if (renderer && (renderer->isBody() || renderer->isRenderView() || renderer->isRoot())) break; if (focusableNode->isFocusable()) { @@ -874,6 +934,14 @@ static IntRect getFocusedRect(HitTestResult hitTestResult, Page* page) break; } + if (focusableNode->supportsFocus() + || focusableNode->hasEventListeners(eventNames().clickEvent) + || focusableNode->hasEventListeners(eventNames().mousedownEvent) + || focusableNode->hasEventListeners(eventNames().mouseupEvent)) { + isFocusRingDrawable = true; + break; + } + focusableNode = focusableNode->parentNode(); } @@ -888,7 +956,11 @@ static IntRect getFocusedRect(HitTestResult hitTestResult, Page* page) } #endif +#if ENABLE(TOUCH_ADJUSTMENT) +void WebPage::hitTestResultAtPoint(const IntPoint& point, int hitTestMode, const IntSize& area, WebHitTestResult::Data& hitTestResultData) +#else void WebPage::hitTestResultAtPoint(const IntPoint& point, int hitTestMode, WebHitTestResult::Data& hitTestResultData) +#endif { Frame* frame = m_page->mainFrame(); FrameView* frameView = frame->view(); @@ -925,7 +997,11 @@ void WebPage::hitTestResultAtPoint(const IntPoint& point, int hitTestMode, WebHi hitTestResultData.hitTestMode = hitTestMode; #if ENABLE(TIZEN_WEBKIT2_FOCUS_RING) +#if ENABLE(TOUCH_ADJUSTMENT) + hitTestResultData.focusedRect = getFocusedRect(hitTestResult, m_page.get(), point, area); +#else hitTestResultData.focusedRect = getFocusedRect(hitTestResult, m_page.get()); +#endif if (hitTestResult.innerNode() && hitTestResult.innerNode()->renderer() && hitTestResult.innerNode()->renderer()->style()) { hitTestResultData.focusedColor = hitTestResult.innerNode()->renderer()->style()->tapHighlightColor(); if (!hitTestResultData.focusedColor.hasAlpha()) @@ -1021,6 +1097,26 @@ void WebPage::resumeJavaScriptAndResources() mainFrame->loader()->resumeAllLoaders(); } +void WebPage::suspendAnimations() +{ + Frame* mainFrame = m_page->mainFrame(); + if (!mainFrame) + return; + + for (Frame* frame = mainFrame; frame; frame = frame->tree()->traverseNext()) + frame->animation()->suspendAnimationsForDocument(frame->document()); +} + +void WebPage::resumeAnimations() +{ + Frame* mainFrame = m_page->mainFrame(); + if (!mainFrame) + return; + + for (Frame* frame = mainFrame; frame; frame = frame->tree()->traverseNext()) + frame->animation()->resumeAnimationsForDocument(frame->document()); +} + #if ENABLE(TIZEN_SYNC_REQUEST_ANIMATION_FRAME) void WebPage::suspendAnimationController() { @@ -1146,19 +1242,6 @@ void WebPage::resumePlugin() } #endif -#if ENABLE(TIZEN_WEBKIT2_GET_TEXT_STYLE_FOR_SELECTION) -void WebPage::getTextStyleStateForSelection() -{ - Frame* frame = m_page->focusController()->focusedOrMainFrame(); - - int underlineState = frame->editor()->selectionHasStyle(CSSPropertyWebkitTextDecorationsInEffect, "underline"); - int italicState = frame->editor()->selectionHasStyle(CSSPropertyFontStyle, "italic"); - int boldState = frame->editor()->selectionHasStyle(CSSPropertyFontWeight, "bold"); - - send(Messages::WebPageProxy::DidGetTextStyleStateForSelection(underlineState, italicState, boldState)); -} -#endif - #if ENABLE(TIZEN_MULTIPLE_SELECT) void WebPage::didChangeSelectedIndexForActivePopupMenuMultiple(Vector newIndex) { @@ -1182,7 +1265,7 @@ void WebPage::startOfflinePageSave(String subresourceFolderName) #endif #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION) -void WebPage::selectClosestWord(const IntPoint& point, bool isStartedTextSelectionFromOutside, bool& result) +void WebPage::selectClosestWord(const IntPoint& point, bool& result) { result = false; @@ -1201,9 +1284,7 @@ void WebPage::selectClosestWord(const IntPoint& point, bool isStartedTextSelecti focusedFrame = newFocusFrame; } -#if ENABLE(TIZEN_INPUT_TAG_EXTENSION) HTMLInputElement* inputElement = node->toInputElement(); -#endif if (hitTestResult.isContentEditable()) { #if ENABLE(TIZEN_INPUT_TAG_EXTENSION) @@ -1235,14 +1316,16 @@ void WebPage::selectClosestWord(const IntPoint& point, bool isStartedTextSelecti } #endif - if (!isStartedTextSelectionFromOutside) { - for (Node* node = hitTestResult.innerNonSharedNode(); node; node = node->parentNode()) { - if (node->isFocusable()) { - // Text selection shoud not be started when text of