SVG TextRuns do not always get RenderingContexts
https://bugs.webkit.org/show_bug.cgi?id=133198
Reviewed by Simon Fraser.
Source/WebCore:
There were a couple places in RenderListMarker and RenderMenuList that were
implicitly creating TextRuns by passing a String to a function which
expected a TextRun. Because TextRun has a constructor which takes a single
String and isn't marked explicit, TextRuns were being created without
any of the associated code that initializes the TextRun (such as creating
a RenderingContext if necessary).
This patch marks the aforementioned constructor as "explicit" to discourage
such behavior in the future.
Test: svg/custom/list-items-with-svg-font-family.html
* platform/graphics/TextRun.h:
(WebCore::TextRun::TextRun): Mark constructors as explicit.
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::computePreferredLogicalWidths): Call
RenderBlock::constructTextRun.
(WebCore::RenderListMarker::getRelativeMarkerRect): Ditto.
* rendering/RenderMenuList.cpp:
(RenderMenuList::updateOptionsWidth): Ditto.
LayoutTests:
See per-file comments.
* svg/custom/list-items-with-svg-font-family-expected.txt: Added.
* svg/custom/list-items-with-svg-font-family.html: Added. Make sure there is
no crash when styling list elements with SVG fonts.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169400
268f45cc-cd09-0410-ab3c-
d52691b4dbfc