return;
}
- WebCore::IntPoint viewPoint = m_viewImpl->transformFromScene().mapPoint(point);
+ WebCore::IntPoint viewPoint;
EditorState editorState = m_viewImpl->page()->editorState();
if (editorState.isContentEditable) {
IntRect mapRect = m_viewImpl->transformToScene().mapRect(editorState.editorRect);
- if(mapRect.contains(point)) {
+ IntPoint updatedPoint = point;
+ if ((point.y() < mapRect.y()) || (point.y() > ((mapRect.y()) + (mapRect.height()))))
+ updatedPoint.setY((mapRect.y()) + ((mapRect.height())/2) );
+
+ if (point.x() < mapRect.x()) {
+ updatedPoint.setX(mapRect.x());
+ if (m_viewImpl->page()->scrollContentByCharacter(point,WebCore::DirectionBackward))
+ updateMagnifier(updatedPoint);
+ } else if (point.x() > ((mapRect.x()) + (mapRect.width()))) {
+ updatedPoint.setX((mapRect.x()) + (mapRect.width()));
+ if (m_viewImpl->page()->scrollContentByCharacter(point,WebCore::DirectionForward))
+ updateMagnifier(updatedPoint);
+ } else {
+ viewPoint = m_viewImpl->transformFromScene().mapPoint(updatedPoint);
m_viewImpl->page()->selectClosestWord(viewPoint, isStartedTextSelectionFromOutside);
- updateMagnifier(point);
+ updateMagnifier(updatedPoint);
}
} else {
+ viewPoint = m_viewImpl->transformFromScene().mapPoint(point);
m_viewImpl->page()->selectClosestWord(viewPoint, isStartedTextSelectionFromOutside);
updateMagnifier(point);
}
#include <WebCore/ContentSecurityPolicy.h>
#endif
+#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
+#include <WebCore/VisibleSelection.h>
+#endif
+
namespace CoreIPC {
class ArgumentDecoder;
class Connection;
bool getSelectionHandlers(WebCore::IntRect& leftRect, WebCore::IntRect& rightRect);
String getSelectionText();
bool selectionRangeClear();
+ bool scrollContentByCharacter(const WebCore::IntPoint&, WebCore::SelectionDirection direction);
#endif
#if ENABLE(TIZEN_LINK_MAGNIFIER)
process()->sendSync(Messages::WebPage::SelectionRangeClear(), Messages::WebPage::SelectionRangeClear::Reply(result), m_pageID);
return result;
}
+
+bool WebPageProxy::scrollContentByCharacter(const IntPoint& point, SelectionDirection direction)
+{
+ if (!isValid())
+ return false;
+
+ bool result = false;
+ process()->sendSync(Messages::WebPage::ScrollContentByCharacter(point, direction), Messages::WebPage::ScrollContentByCharacter::Reply(result), m_pageID);
+ return result;
+}
#endif
#if ENABLE(TIZEN_LINK_MAGNIFIER)
void getSelectionText(String& result);
void selectionRangeClear(bool& result);
void selectionClearAllSelection(WebCore::Frame* frame);
+ void scrollContentByCharacter(const WebCore::IntPoint&, int direction, bool& result);
#endif
#if ENABLE(TIZEN_OFFLINE_PAGE_SAVE)
GetSelectionHandlers() -> (WebCore::IntRect leftRect, WebCore::IntRect rightRect)
GetSelectionText() -> (String result)
SelectionRangeClear() -> (bool result)
+ ScrollContentByCharacter(WebCore::IntPoint point, int direction) -> (bool result)
#endif
#if ENABLE(TIZEN_OFFLINE_PAGE_SAVE)
} else if (frame->tree()->nextSibling())
selectionClearAllSelection(frame->tree()->nextSibling());
}
+
+void WebPage::scrollContentByCharacter(const IntPoint&, int direction, bool& result)
+{
+ result = false;
+
+ Frame* focusedFrame = m_page->focusController()->focusedOrMainFrame();
+ if (direction)
+ result = focusedFrame->selection()->modify(FrameSelection::AlterationMove, DirectionBackward, CharacterGranularity, UserTriggered);
+ else
+ result = focusedFrame->selection()->modify(FrameSelection::AlterationMove, DirectionForward, CharacterGranularity, UserTriggered);
+}
#endif
#if ENABLE(TIZEN_LINK_MAGNIFIER)