Blocked painting of selection for inline inputbox
[framework/web/webkit-efl.git] / Source / WebCore / rendering / InlineTextBox.cpp
index 6edcd1b..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;
 
@@ -1286,10 +1301,13 @@ void InlineTextBox::paintCompositionUnderline(GraphicsContext* ctx, const FloatP
     if (underline.thick && logicalHeight() - baseline >= 2)
         lineThickness = 2;
 
+#if !ENABLE(TIZEN_WEBKIT2_SUPPORT_JAPANESE_IME)
     // We need to have some space between underlines of subsequent clauses, because some input methods do not use different underline styles for those.
     // We make each line shorter, which has a harmless side effect of shortening the first and last clauses, too.
     start += 1;
     width -= 2;
+#endif
+
 
     ctx->setStrokeColor(underline.color, renderer()->style()->colorSpace());
     ctx->setStrokeThickness(lineThickness);