[Title] Fix that text input don't scroll when new character is added at end of box.
authoryoungtaeck.song <youngtaeck.song@samsung.com>
Sat, 8 Sep 2012 09:58:40 +0000 (18:58 +0900)
committeryoungtaeck.song <youngtaeck.song@samsung.com>
Sat, 8 Sep 2012 09:58:40 +0000 (18:58 +0900)
[Issue#] N_SE-9473
[Problem] Fix that text input don't scroll when new character is added at end of box.
[Cause] In this case, do not call text box's scroll function.
[Solution] Call text box's scroll function.

Change-Id: I35b9a953dcc398374cc36cb3c6748e21de9a91bd

Source/WebCore/editing/FrameSelection.cpp
Source/WebCore/editing/FrameSelection.h

index 78d8421..b78c00a 100644 (file)
@@ -1245,7 +1245,11 @@ LayoutRect FrameSelection::localCaretRect()
     return localCaretRectWithoutUpdate();
 }
 
+#if ENABLE(TIZEN_NOT_USE_TRANSFORM_INFO_WHEN_GETTING_CARET_RECT)
+IntRect CaretBase::absoluteBoundsForLocalRect(Node* node, const LayoutRect& rect, bool useTransforms) const
+#else
 IntRect CaretBase::absoluteBoundsForLocalRect(Node* node, const LayoutRect& rect) const
+#endif
 {
     RenderObject* caretPainter = caretRenderer(node);
     if (!caretPainter)
@@ -1256,10 +1260,11 @@ IntRect CaretBase::absoluteBoundsForLocalRect(Node* node, const LayoutRect& rect
         toRenderBox(caretPainter)->flipForWritingMode(localRect);
 
 #if ENABLE(TIZEN_NOT_USE_TRANSFORM_INFO_WHEN_GETTING_CARET_RECT)
-    return caretPainter->localToAbsoluteQuad(FloatRect(localRect), false, 0, false).enclosingBoundingBox();
-#else
-    return caretPainter->localToAbsoluteQuad(FloatRect(localRect)).enclosingBoundingBox();
+    if (!useTransforms)
+        return caretPainter->localToAbsoluteQuad(FloatRect(localRect), false, 0, false).enclosingBoundingBox();
+    else
 #endif
+    return caretPainter->localToAbsoluteQuad(FloatRect(localRect)).enclosingBoundingBox();
 }
 
 IntRect FrameSelection::absoluteCaretBounds()
@@ -1944,11 +1949,11 @@ void FrameSelection::revealSelection(const ScrollAlignment& alignment, bool reve
         return;
     case VisibleSelection::CaretSelection:
 #if ENABLE(TIZEN_NOT_USE_TRANSFORM_INFO_WHEN_GETTING_CARET_RECT)
-        return;
+        rect = absoluteBoundsForLocalRect(m_selection.start().deprecatedNode(), localCaretRectWithoutUpdate(), true);
 #else
         rect = absoluteCaretBounds();
-        break;
 #endif
+        break;
     case VisibleSelection::RangeSelection:
         rect = revealExtent ? VisiblePosition(extent()).absoluteCaretBounds() : enclosingIntRect(bounds(false));
         break;
index 4eda23e..0d5521d 100644 (file)
@@ -59,7 +59,11 @@ protected:
     void invalidateCaretRect(Node*, bool caretRectChanged = false);
     void clearCaretRect();
     bool updateCaretRect(Document*, const VisiblePosition& caretPosition);
+#if ENABLE(TIZEN_NOT_USE_TRANSFORM_INFO_WHEN_GETTING_CARET_RECT)
+    IntRect absoluteBoundsForLocalRect(Node*, const LayoutRect&, bool useTransforms = false) const;
+#else
     IntRect absoluteBoundsForLocalRect(Node*, const LayoutRect&) const;
+#endif
     IntRect caretRepaintRect(Node*) const;
     bool shouldRepaintCaret(const RenderView*, bool isContentEditable) const;
     void paintCaret(Node*, GraphicsContext*, const LayoutPoint&, const LayoutRect& clipRect) const;