DescriptionSet default SVG image font settings
When SVG is loaded as an image, we create a detached Page which
doesn't get default font settings from the embedder. This patch
copies Settings from an existing Page so SVG has sensible defaults.
This fixes two long-standing bugs:
1) The genericFontFamilySettings setting contains font fallback
values that are needed to properly lookup sans-serif glyphs on OSX.
2) An unreadable font-size would be used if no font-size were set.
Another approach is to plumb these settings through from the requesting
Page when creating the SVGImage in ImageResource (i.e., ImageResource
would query it's m_loader which has a FetchContext which references the
requesting Page). This proved to be messy because data:uri images do
not have a loader which means a loader needs to be introduced or a
second codepath is needed from ResourceFetcher to ImageResource. I
think the approach in this patch ends up being cleaner.
With this patch, svg/as-background-image/svg-as-background-{1,3,6}*
no longer outputs sans-serif text on linux and windows. This matches
OSX as well as Gecko.
BUG=167760, 348436
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=196021
Patch Set 1 #Patch Set 2 : Add a test of an svg image document and an externally loaded file #Patch Set 3 : Update expectations #Patch Set 4 : Update expectations #
Total comments: 4
Patch Set 5 : Assert that ordinary pages is not empty #Patch Set 6 : Page::ordinaryPages can be empty in tests (ImageResourceTest) #Messages
Total messages: 19 (6 generated)
|