Blocked painting of selection for inline inputbox
[framework/web/webkit-efl.git] / Source / WebCore / rendering / InlineTextBox.cpp
index 19a3b1b..f5f821b 100644 (file)
@@ -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;