[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
#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
// 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;