Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / rendering / svg / SVGRootInlineBox.cpp
index 55c078d..2a1fafd 100644 (file)
 #include "config.h"
 #include "core/rendering/svg/SVGRootInlineBox.h"
 
+#include "core/paint/SVGRootInlineBoxPainter.h"
 #include "core/rendering/svg/RenderSVGInlineText.h"
 #include "core/rendering/svg/RenderSVGText.h"
 #include "core/rendering/svg/SVGInlineFlowBox.h"
 #include "core/rendering/svg/SVGInlineTextBox.h"
-#include "core/rendering/svg/SVGRenderingContext.h"
 
 namespace blink {
 
 void SVGRootInlineBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, LayoutUnit, LayoutUnit)
 {
-    ASSERT(paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection);
-
-    bool isPrinting = renderer().document().printing();
-    bool hasSelection = !isPrinting && selectionState() != RenderObject::SelectionNone;
-
-    PaintInfo childPaintInfo(paintInfo);
-    if (hasSelection) {
-        for (InlineBox* child = firstChild(); child; child = child->nextOnLine()) {
-            if (child->isSVGInlineTextBox())
-                toSVGInlineTextBox(child)->paintSelectionBackground(childPaintInfo);
-            else if (child->isSVGInlineFlowBox())
-                toSVGInlineFlowBox(child)->paintSelectionBackground(childPaintInfo);
-        }
-    }
-
-    GraphicsContextStateSaver stateSaver(*paintInfo.context);
-    SVGRenderingContext renderingContext(&renderer(), paintInfo);
-    if (renderingContext.isRenderingPrepared()) {
-        for (InlineBox* child = firstChild(); child; child = child->nextOnLine())
-            child->paint(paintInfo, paintOffset, 0, 0);
-    }
+    SVGRootInlineBoxPainter(*this).paint(paintInfo, paintOffset);
 }
 
 void SVGRootInlineBox::markDirty()