Set caret height to object height
authorKyungtae Kim <ktf.kim@samsung.com>
Tue, 21 May 2013 00:47:16 +0000 (09:47 +0900)
committerKyungTae Kim <ktf.kim@samsung.com>
Wed, 22 May 2013 04:41:56 +0000 (13:41 +0900)
[Title] Set caret height to object height
[Issue] P130508-1708
[Problem] When put a image and text on a same line in a object with "contenteditable", the caret is too big.
[Cause] The caret height is set to the selectionHeight to follow Mac port's operation
[Solution] Set caret height to object height - it's more reasonable on Linux ports.

Change-Id: Ibfc150f69b7673d4260f141ec0da9d613a644633

Source/WTF/wtf/Platform.h
Source/WebCore/rendering/RenderText.cpp

index 7f84cb7..937134b 100755 (executable)
 
 #define ENABLE_TIZEN_INFLATE_NONE_BLUR_SHADOW_AREA 1 /*KyungTae Kim(ktf.kim@samsung.com) : Enlarge the clipping area 1 pixel so that the fill does not bleed (due to antialiasing) if the context is transformed*/
 #define ENABLE_TIZEN_NOT_INITIAIZE_BACKGROUND_SIZE_IN_SHORTHAND_WORKAROUND 1 /*KyungTae Kim(ktf.kim@samsung.com) : Do not initialize background-size when the background shorthand doesn't include it(Bug 97761)*/
+#define ENABLE_TIZEN_SET_CARET_HEIGHT_TO_OBJECT_HEIGHT 1 /*KyungTae Kim(ktf.kim@samsung.com) : Set caret height from selection height to object height for fix the case that image and text are in the same line (Bug 116424)*/
 #if USE(FREETYPE)
 #define ENABLE_TIZEN_FT_EMBOLDEN_FOR_SYNTHETIC_BOLD 1 /*Younghwan Cho(yhwan.cho@samsung.com) : Use freetype's 'embolden' instead of drawing twice for synthetic bold*/
 #endif
index f93704d..f8b120c 100644 (file)
@@ -655,8 +655,13 @@ LayoutRect RenderText::localCaretRect(InlineBox* inlineBox, int caretOffset, Lay
 
     InlineTextBox* box = toInlineTextBox(inlineBox);
 
+#if ENABLE(TIZEN_SET_CARET_HEIGHT_TO_OBJECT_HEIGHT)
+    int height = box->logicalHeight();
+    int top = box->logicalTop();
+#else
     int height = box->root()->selectionHeight();
     int top = box->root()->selectionTop();
+#endif
 
     // Go ahead and round left to snap it to the nearest pixel.
     float left = box->positionForOffset(caretOffset);