From: Kyungtae Kim Date: Tue, 21 May 2013 00:47:16 +0000 (+0900) Subject: Set caret height to object height X-Git-Tag: submit/tizen_2.2/20130714.131554~207 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aaaca8473a1f2990af4a1b0e414f6e8a5994f88c;p=framework%2Fweb%2Fwebkit-efl.git Set caret height to object height [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 --- diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h index 7f84cb7..937134b 100755 --- a/Source/WTF/wtf/Platform.h +++ b/Source/WTF/wtf/Platform.h @@ -413,6 +413,7 @@ #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 diff --git a/Source/WebCore/rendering/RenderText.cpp b/Source/WebCore/rendering/RenderText.cpp index f93704d..f8b120c 100644 --- a/Source/WebCore/rendering/RenderText.cpp +++ b/Source/WebCore/rendering/RenderText.cpp @@ -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);