Commit f8a95c3c authored by eric@webkit.org's avatar eric@webkit.org

Reviewed by George Staikos.

        Move RenderSVGText off of localToAbsolute()
        https://bugs.webkit.org/show_bug.cgi?id=25532

        * rendering/RenderSVGText.cpp:
        (WebCore::RenderSVGText::absoluteRects):
        (WebCore::RenderSVGText::absoluteQuads):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@43178 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent d404a6ef
2009-05-03 Eric Seidel <eric@webkit.org>
Reviewed by George Staikos.
Move RenderSVGText off of localToAbsolute()
https://bugs.webkit.org/show_bug.cgi?id=25532
* rendering/RenderSVGText.cpp:
(WebCore::RenderSVGText::absoluteRects):
(WebCore::RenderSVGText::absoluteQuads):
2009-05-03 Eric Seidel <eric@webkit.org>
Reviewed by George Staikos.
......@@ -152,10 +152,6 @@ void RenderSVGText::absoluteRects(Vector<IntRect>& rects, int, int)
RenderSVGRoot* root = findSVGRootObject(parent());
if (!root)
return;
FloatPoint absPos = localToAbsolute();
TransformationMatrix htmlParentCtm = root->RenderBox::absoluteTransform();
// Don't use objectBoundingBox here, as it's unites the selection rects. Makes it hard
// to spot errors, if there are any using WebInspector. Individually feed them into 'rects'.
......@@ -165,9 +161,9 @@ void RenderSVGText::absoluteRects(Vector<IntRect>& rects, int, int)
InlineFlowBox* flowBox = static_cast<InlineFlowBox*>(runBox);
for (InlineBox* box = flowBox->firstChild(); box; box = box->nextOnLine()) {
FloatRect boxRect(box->x(), box->y(), box->width(), box->height());
boxRect.move(narrowPrecisionToFloat(absPos.x() - htmlParentCtm.e()), narrowPrecisionToFloat(absPos.y() - htmlParentCtm.f()));
// FIXME: broken with CSS transforms
rects.append(enclosingIntRect(absoluteTransform().mapRect(boxRect)));
// FIXME: crawling up the parent chain to map each rect is very inefficient
// we should compute the absoluteTransform outside this loop first.
rects.append(enclosingIntRect(localToAbsoluteQuad(boxRect).boundingBox()));
}
}
}
......@@ -177,10 +173,6 @@ void RenderSVGText::absoluteQuads(Vector<FloatQuad>& quads)
RenderSVGRoot* root = findSVGRootObject(parent());
if (!root)
return;
FloatPoint absPos = localToAbsolute();
TransformationMatrix htmlParentCtm = root->RenderBox::absoluteTransform();
// Don't use objectBoundingBox here, as it's unites the selection rects. Makes it hard
// to spot errors, if there are any using WebInspector. Individually feed them into 'rects'.
......@@ -190,9 +182,9 @@ void RenderSVGText::absoluteQuads(Vector<FloatQuad>& quads)
InlineFlowBox* flowBox = static_cast<InlineFlowBox*>(runBox);
for (InlineBox* box = flowBox->firstChild(); box; box = box->nextOnLine()) {
FloatRect boxRect(box->x(), box->y(), box->width(), box->height());
boxRect.move(narrowPrecisionToFloat(absPos.x() - htmlParentCtm.e()), narrowPrecisionToFloat(absPos.y() - htmlParentCtm.f()));
// FIXME: broken with CSS transforms
quads.append(absoluteTransform().mapRect(boxRect));
// FIXME: crawling up the parent chain to map each quad is very inefficient
// we should compute the absoluteTransform outside this loop first.
quads.append(localToAbsoluteQuad(boxRect));
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment