X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=Source%2FWebKit2%2FWebProcess%2FWebPage%2Fefl%2FWebPageEfl.cpp;h=785697b66a66c1c76356f47e56731ba5fdc5f12d;hb=6cfa0d1a8d21fcdb6851fdf7ff67ae713a416eb1;hp=93530d1784b8d6c0d1fc84787165f232f8f8866d;hpb=f64da78562b451cf46eaa371872af98d8c62c2d1;p=framework%2Fweb%2Fwebkit-efl.git diff --git a/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp b/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp index 93530d1..785697b 100755 --- a/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp +++ b/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp @@ -28,6 +28,7 @@ #include "config.h" #include "WebPage.h" +#include "EditorState.h" #include "NamedNodeMap.h" #include "NotImplemented.h" #include "WebEvent.h" @@ -73,8 +74,8 @@ #include #endif -#if ENABLE(TIZEN_WEBKIT2_REMOTE_WEB_INSPECTOR) -#include "WebInspectorServerEfl.h" +#if ENABLE(TIZEN_REMOTE_WEB_INSPECTOR) +#include "WebInspectorServerTizen.h" #endif #if ENABLE(TIZEN_WEB_STORAGE) @@ -138,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 @@ -145,6 +150,15 @@ #if ENABLE(TIZEN_OFFLINE_PAGE_SAVE) #include "WebPageSerializerTizen.h" #endif + +#if ENABLE(TIZEN_USE_SETTINGS_FONT) +#include "fontconfig/fontconfig.h" +#include +#endif + +#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION) +#include "visible_units.h" +#endif #endif // #if OS(TIZEN) using namespace WebCore; @@ -157,9 +171,6 @@ void WebPage::platformInitialize() WebCore::provideDeviceMotionTo(m_page.get(), new DeviceMotionClientTizen); WebCore::provideDeviceOrientationTo(m_page.get(), new DeviceOrientationClientTizen); #endif -#if ENABLE(TIZEN_ISF_PORT) - m_isSettingComposition = false; -#endif } #if ENABLE(TIZEN_PREFERENCE) @@ -167,12 +178,13 @@ void WebPage::platformPreferencesDidChange(const WebPreferencesStore& store) { Settings* settings = m_page->settings(); settings->setInteractiveFormValidationEnabled(store.getBoolValueForKey(WebPreferencesKey::interactiveFormValidationEnabledKey())); - settings->setViewWidth(store.getUInt32ValueForKey(WebPreferencesKey::viewWidthKey())); - settings->setViewHeight(store.getUInt32ValueForKey(WebPreferencesKey::viewHeightKey())); settings->setUsesEncodingDetector(store.getBoolValueForKey(WebPreferencesKey::usesEncodingDetectorKey())); #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 @@ -247,6 +259,109 @@ void WebPage::setThemePath(const String& themePath) theme->setThemePath(themePath); } +static Frame* targetFrameForEditing(WebPage* page) +{ + Frame* frame = page->corePage()->focusController()->focusedOrMainFrame(); + if (!frame) + return 0; + + Editor* editor = frame->editor(); + if (!editor->canEdit()) + return 0; + + if (editor->hasComposition()) { + // We should verify the parent node of this IME composition node are + // editable because JavaScript may delete a parent node of the composition + // node. In this case, WebKit crashes while deleting texts from the parent + // node, which doesn't exist any longer. + if (PassRefPtr range = editor->compositionRange()) { + Node* node = range->startContainer(); + if (!node || !node->isContentEditable()) + return 0; + } + } + + return frame; +} + +void WebPage::confirmComposition(const String& compositionString) +{ + Frame* targetFrame = targetFrameForEditing(this); + 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) + m_page->editorClient()->respondToChangedSelection(targetFrame); +#endif +} + +void WebPage::setComposition(const String& compositionString, const Vector& underlines, uint64_t cursorPosition) +{ + Frame* targetFrame = targetFrameForEditing(this); + if (!targetFrame) + return; + +#if ENABLE(TIZEN_ISF_PORT) + if (!targetFrame->editor()->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) { + unsigned availableLength = textFormControl->maxLength() - textFormControl->value().length(); + if (targetFrame->editor()->hasComposition()) + availableLength += (targetFrame->editor()->compositionEnd() - targetFrame->editor()->compositionStart()); + if (!availableLength) + return; + + if (availableLength < compositionString.length()) { + String newCompositionString = compositionString.substring(0, availableLength); + Vector newUnderlines; + size_t numUnderlines = underlines.size(); + for (size_t index = 0; index < numUnderlines; ++index) { + if (underlines[index].startOffset < availableLength) { + newUnderlines.append(underlines[index]); + if (newUnderlines.last().endOffset > availableLength) + newUnderlines.last().endOffset = availableLength; + } + } + targetFrame->editor()->setComposition(newCompositionString, newUnderlines, cursorPosition, 0); + return; + } + } + } +#endif + + targetFrame->editor()->setComposition(compositionString, underlines, cursorPosition, 0); + +#if ENABLE(TIZEN_ISF_PORT) + m_page->editorClient()->respondToChangedSelection(targetFrame); +#endif +} + +void WebPage::cancelComposition() +{ + Frame* frame = m_page->focusController()->focusedOrMainFrame(); + if (!frame) + return; + + frame->editor()->cancelComposition(); +} + #if OS(TIZEN) #if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE) @@ -404,65 +519,14 @@ void WebPage::createPagesToPDF(const IntSize& surfaceSize, const IntSize& conten } #endif -void WebPage::confirmComposition(const String& compositionString) -{ - Frame* frame = m_page->focusController()->focusedOrMainFrame(); - if (!frame || !frame->editor()->canEdit()) - return; - frame->editor()->confirmComposition(compositionString); -#if ENABLE(TIZEN_ISF_PORT) - updateCursorOffset(); -#endif -} - -void WebPage::setComposition(const String& compositionString, const Vector& underlines, uint64_t cursorPosition) -{ - Frame* frame = m_page->focusController()->focusedOrMainFrame(); - if (!frame || !frame->editor()->canEdit()) - return; -#if ENABLE(TIZEN_ISF_PORT) - if (frame->selection()->rootEditableElement()) { - HTMLTextFormControlElement* textFormControl = toTextFormControl(frame->selection()->rootEditableElement()->shadowAncestorNode()); - if (textFormControl && textFormControl->maxLength() >= 0) { - unsigned availableLength = textFormControl->maxLength() - textFormControl->value().length(); - if (frame->editor()->hasComposition()) - availableLength += (frame->editor()->compositionEnd() - frame->editor()->compositionStart()); - if (!availableLength) - return; - - if (availableLength < compositionString.length()) { - String newCompositionString = compositionString.substring(0, availableLength); - Vector newUnderlines; - size_t numUnderlines = underlines.size(); - for (size_t index = 0; index < numUnderlines; ++index) { - if (underlines[index].startOffset < availableLength) { - newUnderlines.append(underlines[index]); - if (newUnderlines.last().endOffset > availableLength) - newUnderlines.last().endOffset = availableLength; - } - } - frame->editor()->setComposition(newCompositionString, newUnderlines, cursorPosition, 0); - return; - } - } - } - m_isSettingComposition = true; -#endif - frame->editor()->setComposition(compositionString, underlines, cursorPosition, 0); -#if ENABLE(TIZEN_ISF_PORT) - m_isSettingComposition = false; - updateCursorOffset(); -#endif -} - #if ENABLE(TIZEN_TEXT_CARET_HANDLING_WK2) -bool WebPage::setCaretPosition(const WebCore::IntPoint& pos) +bool WebPage::setCaretPosition(const IntPoint& pos) { Frame* frame = m_page->focusController()->focusedOrMainFrame(); if (!frame) return false; - WebCore::FrameSelection* controller = frame->selection(); + FrameSelection* controller = frame->selection(); if (!controller) return false; @@ -470,24 +534,24 @@ bool WebPage::setCaretPosition(const WebCore::IntPoint& pos) if (!frameView) return false; - WebCore::IntPoint point = m_page->mainFrame()->view()->windowToContents(pos); - WebCore::HitTestResult result = m_page->mainFrame()->eventHandler()->hitTestResultAtPoint(point, /*allowShadowContent*/ true, /*ignoreClipping*/ true); + IntPoint point = m_page->mainFrame()->view()->windowToContents(pos); + HitTestResult result = m_page->mainFrame()->eventHandler()->hitTestResultAtPoint(point, /*allowShadowContent*/ true, /*ignoreClipping*/ true); if (result.scrollbar()) return false; - WebCore::Node* innerNode = result.innerNode(); + Node* innerNode = result.innerNode(); if (!innerNode || !innerNode->renderer()) return false; - WebCore::VisiblePosition visiblePos; + VisiblePosition visiblePos; // we check if content is richly editable - because those input field behave other than plain text ones // sometimes they may consists a node structure and they need special approach if (innerNode->rendererIsRichlyEditable()) { // point gets inner node local coordinates point = flooredIntPoint(result.localPoint()); - WebCore::IntRect rect = innerNode->renderer()->absoluteBoundingBoxRect(true); + IntRect rect = innerNode->renderer()->absoluteBoundingBoxRect(true); // it is not the best way to do this, but it is not as slow and it works - so maybe in the future someone // will have a better idea how to solve it @@ -497,13 +561,13 @@ bool WebPage::setCaretPosition(const WebCore::IntPoint& pos) // all those getting nodes rects are needed to bypass WebCore's methods of positioning caret when user // is clicking outside a node - and cheat WebCore telling it that actually we clicked into input field // node, not outside of it - WebCore::Node* deepInnerNode = innerNode->renderer()->positionForPoint(point).deepEquivalent().deprecatedNode(); + Node* deepInnerNode = innerNode->renderer()->positionForPoint(point).deepEquivalent().deprecatedNode(); if (!deepInnerNode || !deepInnerNode->renderer()) return false; // so we get a base node rectange - WebCore::IntRect deepNodeRect = deepInnerNode->renderer()->absoluteBoundingBoxRect(true); + IntRect deepNodeRect = deepInnerNode->renderer()->absoluteBoundingBoxRect(true); // we modify our local point to adjust it to base node local coordinates point.move(rect.x() - deepNodeRect.x(), rect.y() - deepNodeRect.y()); @@ -523,35 +587,46 @@ bool WebPage::setCaretPosition(const WebCore::IntPoint& pos) if (!controller->isCaret() || !controller->caretRenderer()) return false; - const WebCore::Node* node = controller->start().deprecatedNode(); + const Node* node = controller->start().deprecatedNode(); if (!node || !node->renderer()) return false; - WebCore::IntRect rect = controller->caretRenderer()->absoluteBoundingBoxRect(true); + Element* currentRootEditableElement = node->rootEditableElement(); + Element* newRootEditableElement = innerNode->rootEditableElement(); + if (currentRootEditableElement != newRootEditableElement) + return false; + + IntRect rect = controller->caretRenderer()->absoluteBoundingBoxRect(true); -// FIXME: The below codes should be updated to apply the positon of focusedFrame. -#if 0 + // The below wirtten code is not correct way to implement. Presntly the is no + // other working way. To be replaced by better logic // here we also cheat input field that we actually are just inside of if - if (point.x() < rect.x()) - point.setX(rect.x()); - else if (point.x() > rect.maxX()) - point.setX(rect.maxX()); + IntPoint focusedFramePoint = frame->view()->windowToContents(pos); + IntPoint oldFocusedFramePoint = focusedFramePoint; const int boundariesWidth = 2; - if (point.y() < rect.y() + boundariesWidth) - point.setY(rect.y() + boundariesWidth); - else if (point.y() >= rect.maxY() - boundariesWidth) - point.setY(rect.maxY() - boundariesWidth - 1); -#endif + if (focusedFramePoint.x() < rect.x()) + focusedFramePoint.setX(rect.x()); + else if (focusedFramePoint.x() > rect.maxX()) + focusedFramePoint.setX(rect.maxX()); + if (focusedFramePoint.y() < rect.y() + boundariesWidth) + focusedFramePoint.setY(rect.y() + boundariesWidth); + else if (focusedFramePoint.y() >= rect.maxY() - boundariesWidth) + focusedFramePoint.setY(rect.maxY() - boundariesWidth - 1); + + int diffX = focusedFramePoint.x() - oldFocusedFramePoint.x(); + int diffY = focusedFramePoint.y() - oldFocusedFramePoint.y(); + point.setX((point.x())+diffX); + point.setY((point.y())+diffY); // hit test with fake (adjusted) coordinates - WebCore::IntPoint hitTestPoint = m_page->mainFrame()->view()->windowToContents(point); - WebCore::HitTestResult newResult = m_page->mainFrame()->eventHandler()->hitTestResultAtPoint(hitTestPoint, /*allowShadowContent*/ true, /*ignoreClipping*/ true); + IntPoint hitTestPoint = m_page->mainFrame()->view()->windowToContents(point); + HitTestResult newResult = m_page->mainFrame()->eventHandler()->hitTestResultAtPoint(hitTestPoint, /*allowShadowContent*/ true, /*ignoreClipping*/ true); if (!newResult.isContentEditable()) return false; - WebCore::Node* newInnerNode = newResult.innerNode(); + Node* newInnerNode = newResult.innerNode(); if (!newInnerNode || !newInnerNode->renderer()) return false; @@ -563,25 +638,25 @@ bool WebPage::setCaretPosition(const WebCore::IntPoint& pos) } // create visible selection from visible position - WebCore::VisibleSelection newSelection = WebCore::VisibleSelection(visiblePos); - controller->setSelection(newSelection, WebCore::CharacterGranularity); + VisibleSelection newSelection = VisibleSelection(visiblePos); + controller->setSelection(newSelection, CharacterGranularity); // after setting selection caret blinking is suspended by default so we are unsuspedning it controller->setCaretBlinkingSuspended(false); return true; } -void WebPage::getCaretPosition(WebCore::IntRect& rect) +void WebPage::getCaretPosition(IntRect& rect) { Frame* frame = m_page->focusController()->focusedOrMainFrame(); if (!frame) return; - WebCore::FrameSelection* controller = frame->selection(); + FrameSelection* controller = frame->selection(); if (!controller) return; - WebCore::Node* node = controller->start().deprecatedNode(); + Node* node = controller->start().deprecatedNode(); if (!node || !node->renderer() || !node->isContentEditable()) return; @@ -596,26 +671,27 @@ void WebPage::getCaretPosition(WebCore::IntRect& rect) #endif #if ENABLE(TIZEN_ISF_PORT) -void WebPage::updateCursorOffset() -{ - int offset; - getCursorOffset(offset); - send(Messages::WebPageProxy::UpdateCursorOffset(offset)); -} - void WebPage::didCancelComposition(Node* valueChangedNode) { - if (m_isSettingComposition) - return; - Frame* frame = m_page->focusController()->focusedOrMainFrame(); - if (!frame || !valueChangedNode->containsIncludingShadowDOM(frame->editor()->compositionNode())) + if (!frame || frame->editor()->ignoreCompositionSelectionChange() || !valueChangedNode->containsIncludingShadowDOM(frame->editor()->compositionNode())) return; frame->editor()->cancelComposition(); 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; @@ -662,7 +738,7 @@ void WebPage::getSelectionRect(bool isOnlyEditable, IntRect& rect) if (selection->isCaret()) rect = frame->view()->contentsToWindow(selection->absoluteCaretBounds()); else if (selection->isRange()) - rect = frame->view()->contentsToWindow(enclosingIntRect(selection->bounds())); + rect = frame->view()->contentsToWindow(enclosingIntRect(selection->bounds(false))); } void WebPage::deleteSurroundingText(int offset, int count) @@ -671,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); @@ -698,8 +779,6 @@ void WebPage::setFocusedInputElementValue(const String& inputValue) inputElement->toNode()->dispatchFocusEvent(0); inputElement->setValue(inputValue, DispatchChangeEvent); - - updateCursorOffset(); } void WebPage::getFocusedInputElementValue(String& inputValue) @@ -820,36 +899,98 @@ static IntRect getNodeRect(Node* node, Node* focusableNode, bool isImage) #if ENABLE(TIZEN_WEBKIT2_HIT_TEST) #if ENABLE(TIZEN_WEBKIT2_FOCUS_RING) +static bool isClickableOrFocusable(Node* focusableNode) +{ + + if (!focusableNode) + return false; + if (focusableNode->disabled()) + return false; + if (!focusableNode->inDocument()) + return false; + if (!focusableNode->renderer() || focusableNode->renderer()->style()->visibility() != VISIBLE) + return false; + if (focusableNode->isFocusable()) { + if (focusableNode->isLink() + || focusableNode->hasTagName(HTMLNames::inputTag) + || focusableNode->hasTagName(HTMLNames::selectTag) + || focusableNode->hasTagName(HTMLNames::buttonTag)) + return true; + } + if (focusableNode->supportsFocus() + || focusableNode->hasEventListeners(eventNames().clickEvent) + || focusableNode->hasEventListeners(eventNames().mousedownEvent) + || focusableNode->hasEventListeners(eventNames().mouseupEvent)) { + return true; + } + return false; +} + +#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(); + if (!isClickableOrFocusable(node)) + mainFrame->eventHandler()->bestClickableNodeForTouchPoint(point, IntSize(area.width() / 2, area.height() / 2), adustedPoint, adjustedNode); + + if (adjustedNode) + node = adjustedNode; +#endif + if (!node) + return IntRect(); + bool isFocusRingDrawable = false; 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()) { - if (focusableNode->isLink() - || focusableNode->hasTagName(HTMLNames::inputTag) - || focusableNode->hasTagName(HTMLNames::selectTag) - || focusableNode->hasTagName(HTMLNames::buttonTag)) - isFocusRingDrawable = true; + if (isClickableOrFocusable(focusableNode)) { + isFocusRingDrawable = true; break; } focusableNode = focusableNode->parentNode(); } - if (!isFocusRingDrawable) + // Don't draw focus ring if child is focusable or has trigger + if (focusableNode && focusableNode->isContainerNode() && !focusableNode->isLink()) { + WebCore::Node *child = static_cast(focusableNode)->firstChild(); + while(child) { + if( child->supportsFocus() + || child->hasEventListeners(eventNames().clickEvent) + || child->hasEventListeners(eventNames().mousedownEvent) + || child->hasEventListeners(eventNames().mouseupEvent)) { + return IntRect(); + } + child = child->traverseNextNode(focusableNode); + } + } + + if (!isFocusRingDrawable) { + if (node->hasTagName(HTMLNames::imgTag)) + return getNodeRect(node, node, !hitTestResult.absoluteImageURL().isEmpty()); + return IntRect(); + } return getNodeRect(node, focusableNode, !hitTestResult.absoluteImageURL().isEmpty()); } #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(); @@ -862,6 +1003,7 @@ void WebPage::hitTestResultAtPoint(const IntPoint& point, int hitTestMode, WebHi hitTestResultData.absoluteMediaURL = hitTestResult.absoluteMediaURL().string(); hitTestResultData.linkLabel = hitTestResult.textContent(); hitTestResultData.linkTitle = hitTestResult.titleDisplayString(); + hitTestResultData.isContentEditable = hitTestResult.isContentEditable(); #if ENABLE(TIZEN_DRAG_SUPPORT) hitTestResultData.isDragSupport = hitTestResult.isDragSupport(); #endif @@ -885,7 +1027,19 @@ 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 + + // Don't display FocusRect if the size is too big.. + IntRect framerect = frameView->visibleContentRect(true); + if (hitTestResultData.focusedRect.width() > (0.8 * framerect.width()) + && hitTestResultData.focusedRect.height() > (0.8 * framerect.height())) { + hitTestResultData.focusedRect = IntRect(); + } + if (hitTestResult.innerNode() && hitTestResult.innerNode()->renderer() && hitTestResult.innerNode()->renderer()->style()) { hitTestResultData.focusedColor = hitTestResult.innerNode()->renderer()->style()->tapHighlightColor(); if (!hitTestResultData.focusedColor.hasAlpha()) @@ -943,13 +1097,6 @@ void WebPage::setStorageQuotaBytes(uint32_t quota) } #endif -#if ENABLE(TIZEN_RECORDING_SURFACE_SET) -void WebPage::recordingSurfaceSetEnableSet(bool enable) -{ - m_recordingSurfaceSetSettings = enable; -} -#endif - #if ENABLE(TIZEN_CLIPBOARD) || ENABLE(TIZEN_PASTEBOARD) void WebPage::setClipboardDataForPaste(const String& data, const String& type) { @@ -988,6 +1135,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() { @@ -1018,19 +1185,19 @@ void WebPage::resumeAnimationController() } #endif -#if ENABLE(TIZEN_WEBKIT2_REMOTE_WEB_INSPECTOR) +#if ENABLE(TIZEN_REMOTE_WEB_INSPECTOR) void WebPage::startInspectorServer(uint32_t port, uint32_t& allocatedPort) { - bool ret = WebInspectorServerEfl::server()->startServer(port); + bool ret = WebInspectorServerTizen::server()->startServer(port); if (ret) - allocatedPort = WebInspectorServerEfl::server()->getServerPort(); + allocatedPort = WebInspectorServerTizen::server()->getServerPort(); else allocatedPort = 0; } void WebPage::stopInspectorServer(bool& result) { - result = WebInspectorServerEfl::server()->stopServer(); + result = WebInspectorServerTizen::server()->stopServer(); } #endif @@ -1054,7 +1221,7 @@ void WebPage::setPressedNodeAtPoint(const IntPoint& point, bool checkOverflowLay { RenderObject* renderer = 0; id = 0; - pressed = m_page->focusController()->focusedOrMainFrame()->eventHandler()->setMousePressNodeAtPoint(point, checkOverflowLayer, renderer); + pressed = m_page->mainFrame()->eventHandler()->setMousePressNodeAtPoint(point, checkOverflowLayer, renderer); #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION_ON_UI_SIDE) if (pressed && renderer) id = toWebGraphicsLayer(renderer->enclosingLayer()->layerForScrollingContents())->id(); @@ -1113,19 +1280,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) { @@ -1149,7 +1303,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; @@ -1168,15 +1322,9 @@ 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_ISF_PORT) - if (focusedFrame) - didCancelComposition(node); -#endif #if ENABLE(TIZEN_INPUT_TAG_EXTENSION) if (!inputElement || (inputElement && !inputElement->isDateField() && !inputElement->isDateTimeField() && !inputElement->isDateTimeLocalField() @@ -1197,14 +1345,25 @@ void WebPage::selectClosestWord(const IntPoint& point, bool isStartedTextSelecti #endif return; - if (!isStartedTextSelectionFromOutside) { - for (Node* node = hitTestResult.innerNonSharedNode(); node; node = node->parentNode()) { - if (node->isFocusable()) { - // Text selection shoud not be started when text of