svg/W3C-SVG-1.1/render-groups-03-t.svg and some other SVG tests leak documents
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Sep 2018 21:19:49 +0000 (21:19 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Sep 2018 21:19:49 +0000 (21:19 +0000)
commitf6ef52033f98b73ef3a8cdcda769d84054df8296
treea483abb3864dbb0d3d6fcccb59e481d9145f2eab
parent40a5ee1448f3cb437c576467cd0e8b9911766ec8
svg/W3C-SVG-1.1/render-groups-03-t.svg and some other SVG tests leak documents
https://bugs.webkit.org/show_bug.cgi?id=189147

Reviewed by Dean Jackson.

Document::removedLastRef() needs to clean up m_fontSelector, because it can reference
CSSFontFaceSources that keep SVGFontFaceElements alive, and they in turn will keep
the Document alive.

Also add the beginnings of a Fonts log channel.

This will be tested by world leak testing (webkit.org/b/189332).

* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::CSSFontSelector):
(WebCore::CSSFontSelector::~CSSFontSelector):
* dom/Document.cpp:
(WebCore::Document::removedLastRef):
* platform/Logging.h:
* platform/graphics/FontCache.cpp:
(WebCore::FontCache::purgeInactiveFontDataIfNeeded):
(WebCore::FontCache::purgeInactiveFontData):
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::SVGFontFaceElement):
(WebCore::SVGFontFaceElement::~SVGFontFaceElement):
* svg/SVGFontFaceElement.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235862 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/css/CSSFontSelector.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/platform/Logging.h
Source/WebCore/platform/graphics/FontCache.cpp
Source/WebCore/svg/SVGFontFaceElement.cpp
Source/WebCore/svg/SVGFontFaceElement.h