User installed fonts are not always disabled when they should be
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Oct 2018 17:57:41 +0000 (17:57 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Oct 2018 17:57:41 +0000 (17:57 +0000)
commit6281c219a2dfab907e8114934d26baf7c8f473b4
tree2c493ee3a6bee3bd5be70ed2a017f7e7c3e9e5c2
parent3696e0614d67fbe0e3ab8a5a133f507674273ba9
User installed fonts are not always disabled when they should be
https://bugs.webkit.org/show_bug.cgi?id=190195

Reviewed by Geoffrey Garen.

SVG images and some theme cases fail to respect the setting. Besides the obvious problem this
is also a performance issue as various font caches include this setting in the key.

* platform/graphics/FontDescription.cpp:
(WebCore::m_shouldAllowUserInstalledFonts):

Initialize to 'No' by default. All paths where user fonts make sense already set the bit from
settings. This fixes some cases in system themes that construct FontDescriptions from scratch.

* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleWillChange):

Add assertion. This verified the change with the existing tests.

* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::dataChanged):

Always disallow user fonts in SVG used as images.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236753 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/FontDescription.cpp
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/svg/graphics/SVGImage.cpp