haikuwebkit/LayoutTests/svg/custom/list-items-with-svg-font-fa...

29 lines
612 B
HTML
Raw Permalink Normal View History

Lists styled with SVG fonts are not rendered as expected 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). There is currently one more client of this code that needs to be fixed. This is in RenderThemeIOS::adjustMenuListButtonStyle(). However, fixing this will be a somewhat large change, and is out of scope for this patch. I will submit a follow-up patch that fixes this permanently. Once this is fixed, I can mark TextRun's constructors as explicit. 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. * rendering/RenderThemeIOS.mm: (WebCore::adjustInputElementButtonStyle): Instead of crashing, mark form controls rendered with SVG fonts as having 0 width. This isn't perfect, but fixing this is out of scope for this patch. LayoutTests: See per-file comments. * platform/ios-sim/fonts/input-style-with-svg-font-crash.html: Added. Make sure that iOS input elements don't crash when styled with SVG fonts. * platform/ios-sim/fonts/resources/graffiti.svg: Added. SVG font for above test. * 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. Canonical link: https://commits.webkit.org/151522@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169591 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-06-04 20:22:16 +00:00
<style>
@font-face {
font-family: 'SVGraffiti';
src: url("resources/graffiti.svg#SVGraffiti") format(svg)
}
li.a {
font-size: 30px;
font-family: SVGraffiti;
list-style-type: lower-roman;
}
li.b {
font-size: 30px;
font-family: SVGraffiti;
list-style-type: asterisks;
}
</style>
This test makes sure that styling list elements with an SVG font does not cause a crash.
<br>
This test is successful if there is no crash.
<ol>
<li class="a">element</li>
<li class="a">element</li>
<li class="b">element</li>
</ol>
<script>
if (window.testRunner)
testRunner.dumpAsText();
</script>