From: prathmesh.m Date: Wed, 19 Jun 2013 10:39:09 +0000 (+0530) Subject: Blocked painting of selection for inline inputbox X-Git-Tag: 2.2_release~28 X-Git-Url: http://review.tizen.org/git/?p=framework%2Fweb%2Fwebkit-efl.git;a=commitdiff_plain;h=f81ad874ea9b40b47fb48aece92cc2edccb518a7 Blocked painting of selection for inline inputbox [Title] Blocked painting of selection for inline inputbox [Issue#] N/A [Problem] Select content and extend it to input box when the IME is not up (input node not focused) and the copy the text. Text inside the input box is not copied but painted for selection [Cause] The input box content is in shadow root. So this content is not selected. But while painting there is such condition. All the contents are getting painted [Solution] Checking if the content is in shadow root then do not paint the selection as it is not selected in the dom selection Change-Id: Ieaf87576d9ec961016982a7c0a1dd1c003315bb3 --- diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h index 0621ea4..ec13002 100755 --- a/Source/WTF/wtf/Platform.h +++ b/Source/WTF/wtf/Platform.h @@ -681,6 +681,7 @@ com) : Patch to do not adjust cover rect as fixed pixel size*/ #define ENABLE_TIZEN_WEBKIT2_CONTEXT_X_WINDOW 1 /* Changhyup Jwa(ch.jwa@samsung.com) : WebProcess cannot access to evas, so it needs to obtain window id to get window's orientation. Default root window has sync issue. */ #define ENABLE_TIZEN_WEBKIT2_FOR_MOVING_TEXT_SELECTION_HANDLE_FROM_OSP 1 /* Yuni Jeong(yhnet.jung@samsung.com) : Patchs for moving text selection handle from OSP */ #define ENABLE_TIZEN_WEBKIT2_FIX_INVAlID_SCROLL_FOR_NEW_PAGE 1 /* Jongseok Yang (js45.yang@samsung.com) : Patch to fix the invalid scroll position by open source patch */ +#define ENABLE_TIZEN_WEBKIT2_TEXT_SELECTION_NOT_PAINT_SELECTION_FOR_INPUTBOX 1 /* Prathmesh Manurkar(prathmesh.m@samsung.com) : Patch for not painting the selection for Contents Inside the input.Selection is not painted when the focus in outside the input box */ #endif /* ENABLE(TIZEN_WEBKIT2) */ /* When displaying menu list using menu icon, a additional scrollbar is displayed in the screen center diff --git a/Source/WebCore/rendering/InlineTextBox.cpp b/Source/WebCore/rendering/InlineTextBox.cpp index 19a3b1b..f5f821b 100644 --- a/Source/WebCore/rendering/InlineTextBox.cpp +++ b/Source/WebCore/rendering/InlineTextBox.cpp @@ -852,6 +852,21 @@ void InlineTextBox::paintSelection(GraphicsContext* context, const FloatPoint& b // See if we have a selection to paint at all. int sPos, ePos; selectionStartEnd(sPos, ePos); +#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION_NOT_PAINT_SELECTION_FOR_INPUTBOX) + Node* shadowAncestor = 0; + if (renderer() && renderer()->node()) + shadowAncestor = renderer()->node()->shadowAncestorNode(); + + if (shadowAncestor && (shadowAncestor->renderer()->isTextField() || shadowAncestor->renderer()->isTextArea())) { + if (selectionState() != RenderObject::SelectionBoth) { + RenderObject* startObj = textRenderer()->view()->selectionStart(); + RenderObject* endObj = textRenderer()->view()->selectionEnd(); + if (!(startObj->node()->isInShadowTree() && endObj->node()->isInShadowTree())) + return; + } + } +#endif + if (sPos >= ePos) return;