Clean up: Have SVGTextLayoutEngine::beginTextPathLayout() take a reference to a
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Apr 2015 22:35:42 +0000 (22:35 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Apr 2015 22:35:42 +0000 (22:35 +0000)
commit42595fe7f9e78dd61db89a1ffc3ccf9cd1b1e620
tree902f609522d1ef2a1e0424e7b28f8d38c8cfe81b
parent0c3092f426a4e25a90f9fb27bee658c27dc8bc61
Clean up: Have SVGTextLayoutEngine::beginTextPathLayout() take a reference to a
RenderSVGTextPath instead of a pointer
https://bugs.webkit.org/show_bug.cgi?id=143787

Reviewed by Andreas Kling.

SVGTextLayoutEngine::beginTextPathLayout() assumes that the passed RenderObject is a
non-null pointer to a RenderSVGTextPath object. Instead we should have this function take a
reference to a RenderSVGTextPath object to help callers catch bad usage and better document
the expectation of a valid RenderSVGTextPath object.

* rendering/svg/SVGRootInlineBox.cpp:
(WebCore::SVGRootInlineBox::layoutCharactersInTextBoxes): Downcast the renderer of the
inline box to a RenderSVGTextPath object and pass it to SVGTextLayoutEngine::beginTextPathLayout().
We ensured that this cast is safe earlier in this function.
SVGTextLayoutEngine::beginTextPathLayout().
* rendering/svg/SVGTextLayoutEngine.cpp:
(WebCore::SVGTextLayoutEngine::beginTextPathLayout): Change type of first parameter from
RenderObject* to RenderSVGTextPath. Remove ASSERT() that was checking for a non-null
RenderObject pointer since we are passing the renderer by reference and a well-formed
reference must refer to a valid object.
* rendering/svg/SVGTextLayoutEngine.h: Substitute RenderSVGTextPath& for RenderObject*.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182864 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/rendering/svg/SVGRootInlineBox.cpp
Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp
Source/WebCore/rendering/svg/SVGTextLayoutEngine.h