Revert "Refine focus ring repainting code when web contents was changed."
authorJongseok Yang <js45.yang@samsung.com>
Thu, 2 May 2013 12:42:32 +0000 (21:42 +0900)
committerGerrit Code Review <gerrit2@kim11>
Thu, 2 May 2013 12:47:12 +0000 (21:47 +0900)
This reverts commit c8bdeda433cfa1f863fde9b3d502fe79bfd6ea34

Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp
Source/WebKit2/UIProcess/API/efl/EwkViewImpl.h
Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp
Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
Source/WebKit2/UIProcess/efl/InputMethodContextEfl.cpp
Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp [changed mode: 0755->0644]
Source/WebKit2/WebProcess/WebPage/WebPage.h [changed mode: 0755->0644]
Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp [changed mode: 0755->0644]
Source/WebKit2/WebProcess/WebPage/efl/tizen/ScreenReader.cpp [changed mode: 0755->0644]
Source/WebKit2/WebProcess/WebPage/efl/tizen/ScreenReader.h [changed mode: 0755->0644]

index abd00da..650d8fd 100755 (executable)
@@ -1395,15 +1395,4 @@ void EwkViewImpl::feedTouchEventsByType(Ewk_Touch_Event_Type type)
     feedTouchEvents(type);
 }
 #endif
-
-void EwkViewImpl::didChangeScrollAndScale(const WebCore::IntPoint& previousScrollPosition, float previousScale)
-{
-#if ENABLE(TIZEN_WEBKIT2_FOCUS_RING)
-    if (!focusRing)
-        return;
-
-    if (!focusRing->rect().isEmpty())
-        focusRing->updateScrollAndScale(previousScrollPosition, previousScale);
-#endif
-}
 #endif //#if OS(TIZEN)
index 86c7f96..02cd6cb 100755 (executable)
@@ -319,8 +319,6 @@ public:
 #if ENABLE(TOUCH_EVENTS) && ENABLE(TIZEN_GESTURE)
     void feedTouchEventsByType(Ewk_Touch_Event_Type);
 #endif
-
-    void didChangeScrollAndScale(const WebCore::IntPoint&, float);
 #endif
 
     // FIXME: Make members private for encapsulation.
index ef68737..7c9b1f5 100755 (executable)
 #include "ewk_context_private.h"
 #endif
 
+#if ENABLE(TIZEN_SCREEN_READER)
+#include "ScreenReaderProxy.h"
+#endif
+
 using namespace WebCore;
 using namespace std;
 
@@ -297,6 +301,11 @@ void PageClientImpl::setViewNeedsDisplay(const WebCore::IntRect& rect)
 #else
     m_viewImpl->redrawRegion(rect);
 #endif
+
+#if ENABLE(TIZEN_SCREEN_READER)
+    if (rect.intersects(ewkViewGetFocusRing(m_viewImpl->view())->rect()))
+        m_viewImpl->page()->recalcScreenReaderFocusRect();
+#endif
 }
 
 void PageClientImpl::displayView()
@@ -811,7 +820,7 @@ IntRect PageClientImpl::adjustVisibleContentRect(IntRect visibleContentRect, flo
 
 void PageClientImpl::setVisibleContentRect(const IntRect& newRect, float newScale, const FloatPoint& trajectory)
 {
-#if OS(TIZEN)
+#if ENABLE(TIZEN_SCREEN_READER)
     IntPoint previousScrollPosition(scrollPosition());
     float previousScale = m_scaleFactor;
 #endif
@@ -850,9 +859,10 @@ void PageClientImpl::setVisibleContentRect(const IntRect& newRect, float newScal
 #endif
     displayViewport();
 
-#if OS(TIZEN)
-    if (scrollPosition() != previousScrollPosition || m_scaleFactor != previousScale)
-        m_viewImpl->didChangeScrollAndScale(previousScrollPosition, previousScale);
+#if ENABLE(TIZEN_SCREEN_READER)
+    if (ScreenReaderProxy::screenReader().isEnabled()
+        && (scrollPosition() != previousScrollPosition || m_scaleFactor != previousScale))
+        ewkViewGetFocusRing(m_viewImpl->view())->updateScrollAndScale(previousScrollPosition, previousScale);
 #endif
 
 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
@@ -868,6 +878,10 @@ void PageClientImpl::displayViewport()
 #if ENABLE(TIZEN_WEBKIT2_TILED_SCROLLBAR)
     updateScrollbar();
 #endif
+
+#if ENABLE(TIZEN_SCREEN_READER)
+    m_viewImpl->page()->recalcScreenReaderFocusRect();
+#endif
 }
 
 void PageClientImpl::drawContents()
@@ -1459,6 +1473,11 @@ void PageClientEvasGL::setViewNeedsDisplay(const WebCore::IntRect& rect)
 #endif
     drawContents();
     m_viewImpl->redrawRegion(rect);
+
+#if ENABLE(TIZEN_SCREEN_READER)
+    if (rect.intersects(ewkViewGetFocusRing(m_viewImpl->view())->rect()))
+        m_viewImpl->page()->recalcScreenReaderFocusRect();
+#endif
 }
 
 void PageClientEvasGL::displayViewport()
@@ -1475,6 +1494,10 @@ void PageClientEvasGL::displayViewport()
 #if ENABLE(TIZEN_WEBKIT2_TILED_SCROLLBAR)
     updateScrollbar();
 #endif
+
+#if ENABLE(TIZEN_SCREEN_READER)
+    m_viewImpl->page()->recalcScreenReaderFocusRect();
+#endif
 }
 
 void PageClientEvasGL::drawContents()
index 0d1974f..6917335 100644 (file)
@@ -974,6 +974,9 @@ static void _ewk_view_smart_calculate(Evas_Object* ewkView)
 #if ENABLE(TIZEN_WEBKIT2_TILED_SCROLLBAR)
         impl->pageClient->frameRectChanged();
 #endif
+#if ENABLE(TIZEN_SCREEN_READER)
+        impl->pageProxy->recalcScreenReaderFocusRect();
+#endif
 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
         impl->pageClient->updateTextSelectionHandlesAndContextMenu(true);
 #endif
index 4df0caf..9cfdc63 100755 (executable)
@@ -325,7 +325,7 @@ void InputMethodContextEfl::handleKeyDownEvent(const Evas_Event_Key_Down* downEv
 void InputMethodContextEfl::updateTextInputState()
 {
     const EditorState& editor = m_viewImpl->page()->editorState();
-    if (editor.shouldIgnoreCompositionSelectionChange || editor.updateEditorRectOnly)
+    if (editor.shouldIgnoreCompositionSelectionChange)
         return;
 
     if (editor.isContentEditable && m_useInputMethod)
old mode 100755 (executable)
new mode 100644 (file)
index 38f813a..204effd
@@ -89,10 +89,6 @@ void DrawingAreaImpl::setNeedsDisplay(const IntRect& rect)
     if (dirtyRect.isEmpty())
         return;
 
-#if OS(TIZEN)
-    m_webPage->didChangeContents(dirtyRect);
-#endif
-
     if (m_layerTreeHost) {
         ASSERT(m_dirtyRegion.isEmpty());
 
@@ -112,10 +108,6 @@ void DrawingAreaImpl::scroll(const IntRect& scrollRect, const IntSize& scrollOff
     if (!m_isPaintingEnabled)
         return;
 
-#if OS(TIZEN)
-    m_webPage->didChangeContents(scrollRect);
-#endif
-
     if (m_layerTreeHost) {
         ASSERT(m_scrollRect.isEmpty());
         ASSERT(m_scrollOffset.isEmpty());
old mode 100755 (executable)
new mode 100644 (file)
index b9bbb04..6d8d14d
@@ -777,10 +777,6 @@ public:
     void useSettingsFont();
 #endif
 
-#if OS(TIZEN)
-    void didChangeContents(const WebCore::IntRect&);
-#endif
-
 private:
     WebPage(uint64_t pageID, const WebPageCreationParameters&);
 
old mode 100755 (executable)
new mode 100644 (file)
index 362b65b..fda5383
@@ -1543,22 +1543,15 @@ void WebPage::raiseTapEvent(const IntPoint& position, const IntPoint& globalPosi
     frame->eventHandler()->handleTouchEvent(platform(touchEndEvent));
 }
 
-static void sendScreenReaderFocusRect(WebPage* page, ScreenReader* screenReader)
+static void sendScreenReaderFocusRect(WebPage* page, Node* node)
 {
-    Node* node = screenReader->getFocusedNode();
-    IntRect rect;
-
-    if (node) {
-        bool isImage = false;
-        if (node->isElementNode()) {
-            Element* element = static_cast<Element*>(node);
-            isImage = !element->getAttribute(element->imageSourceAttributeName()).isEmpty();
-        }
-        rect = getNodeRect(node, node, isImage);
+    bool isImage = false;
+    if (node->isElementNode()) {
+        Element* element = static_cast<Element*>(node);
+        isImage = !element->getAttribute(element->imageSourceAttributeName()).isEmpty();
     }
 
-    screenReader->setFocusedRect(rect);
-    page->send(Messages::WebPageProxy::DidScreenReaderFocusRectChanged(rect));
+    page->send(Messages::WebPageProxy::DidScreenReaderFocusRectChanged(getNodeRect(node, node, isImage)));
 }
 
 void WebPage::moveScreenReaderFocus(bool forward, bool& result)
@@ -1566,8 +1559,14 @@ void WebPage::moveScreenReaderFocus(bool forward, bool& result)
     if (!m_screenReader)
         m_screenReader = ScreenReader::create(this);
 
-    result = m_screenReader->moveFocus(forward);
-    sendScreenReaderFocusRect(this, m_screenReader.get());
+    if (!m_screenReader->moveFocus(forward)) {
+        result = false;
+        send(Messages::WebPageProxy::DidScreenReaderFocusRectChanged(IntRect()));
+        return;
+    } else {
+        result = true;
+        sendScreenReaderFocusRect(this, m_screenReader->getFocusedNode());
+    }
 }
 
 void WebPage::moveScreenReaderFocusByPoint(const IntPoint& point)
@@ -1578,7 +1577,7 @@ void WebPage::moveScreenReaderFocusByPoint(const IntPoint& point)
     if (!m_screenReader->moveFocus(point))
         return;
 
-    sendScreenReaderFocusRect(this, m_screenReader.get());
+    sendScreenReaderFocusRect(this, m_screenReader->getFocusedNode());
 }
 
 void WebPage::recalcScreenReaderFocusRect()
@@ -1586,7 +1585,7 @@ void WebPage::recalcScreenReaderFocusRect()
     if (!m_screenReader || !m_screenReader->getFocusedNode())
         return;
 
-    sendScreenReaderFocusRect(this, m_screenReader.get());
+    sendScreenReaderFocusRect(this, m_screenReader->getFocusedNode());
 }
 
 void WebPage::updateScreenReaderFocus(RenderObject* object)
@@ -1599,7 +1598,7 @@ void WebPage::updateScreenReaderFocus(RenderObject* object)
     else if (!m_screenReader->rendererWillBeDestroyed(object))
         return;
 
-    sendScreenReaderFocusRect(this, m_screenReader.get());
+    send(Messages::WebPageProxy::DidScreenReaderFocusRectChanged(IntRect()));
 }
 
 void WebPage::clearScreenReader()
@@ -1666,22 +1665,6 @@ void WebPage::useSettingsFont()
     frameView->forceLayout();
 }
 #endif
-
-void WebPage::didChangeContents(const IntRect& rect)
-{
-#if ENABLE(TIZEN_ISF_PORT)
-    if (m_editorState.isContentEditable && rect.intersects(m_editorState.editorRect)) {
-        m_editorState = editorState();
-        m_editorState.updateEditorRectOnly = true;
-        send(Messages::WebPageProxy::EditorStateChanged(m_editorState));
-    }
-#endif
-
-#if ENABLE(TIZEN_SCREEN_READER)
-    if (m_screenReader && rect.intersects(m_screenReader->focusedRect()))
-        recalcScreenReaderFocusRect();
-#endif
-}
 #endif // #if OS(TIZEN)
 
 } // namespace WebKit
old mode 100755 (executable)
new mode 100644 (file)
index c4cb741..67b8ec3
@@ -579,7 +579,6 @@ bool ScreenReader::rendererWillBeDestroyed(RenderObject* object)
 void ScreenReader::clearFocus()
 {
     m_focusedObject = 0;
-    m_focusedRect = IntRect();
     m_hasFocus = false;
     m_page->send(Messages::WebPageProxy::DidScreenReaderTextChanged(emptyString()));
 }
old mode 100755 (executable)
new mode 100644 (file)
index ea19cb0..b1f30cc
@@ -57,9 +57,6 @@ public:
     bool rendererWillBeDestroyed(WebCore::RenderObject*);
     void clearFocus();
 
-    const WebCore::IntRect& focusedRect() const { return m_focusedRect; }
-    void setFocusedRect(const WebCore::IntRect& rect) { m_focusedRect = rect; }
-
 private:
     ScreenReader(WebPage*);
 
@@ -73,7 +70,6 @@ private:
 
     WebPage* m_page;
     WebCore::RenderObject* m_focusedObject;
-    WebCore::IntRect m_focusedRect;
     bool m_hasFocus;
     bool m_isForward;