Reviewed by Darin Adler.
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 Jul 2008 00:00:13 +0000 (00:00 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 Jul 2008 00:00:13 +0000 (00:00 +0000)
commitc2fe152d3926d7455f233b2f019cbf2b698eae43
treee04b09e6c87f2aadc6248a01b2f49e8b78e06fb9
parentaf6c9723677de730772ffe43ce1f8e1337bc8d9e
    Reviewed by Darin Adler.

        - fix <rdar://problem/5735163> WebCore caching makes text look wrong after font changes; need to respond appropriately instead

        * css/CSSFontSelector.cpp:
        (WebCore::CSSFontSelector::CSSFontSelector): Added a call to
        FontCache::addClient().
        (WebCore::CSSFontSelector::~CSSFontSelector): Added a call to
        FontCache::removeClient().
        (WebCore::CSSFontSelector::fontCacheInvalidated): Added. Called by the
        font cache when it is invalidated, and ensures that the document is
        updated.

        * css/CSSFontSelector.h:

        * platform/graphics/Font.cpp:
        (WebCore::Font::operator==): Added code to compare the font fallback
        lists' font cache generations.

        * platform/graphics/FontCache.cpp:
        (WebCore::FontCache::addClient): Added.
        (WebCore::FontCache::removeClient): Added.
        (WebCore::FontCache::generation): Added.
        (WebCore::FontCache::invalidate): Added. Deletes the platform data
        cache, increments the generation counter, and notifies all clients.

        * platform/graphics/FontCache.h:

        * platform/graphics/FontFallbackList.cpp:
        (WebCore::FontFallbackList::FontFallbackList): Added initialization of
        m_generation.
        (WebCore::FontFallbackList::invalidate): Added code to reset
        m_generation.
        (WebCore::FontFallbackList::fontDataAt): Added an assertion.
        (WebCore::FontFallbackList::fontDataForCharacters): Ditto.
        (WebCore::FontFallbackList::setPlatformFont): Ditto.

        * platform/graphics/FontFallbackList.h:
        (WebCore::FontFallbackList::generation): Added. Returns the font cache
        generation used to populate the list.

        * platform/graphics/FontSelector.h:
        (WebCore::FontSelector::fontCacheInvalidated): Added.

        * platform/graphics/mac/FontCacheMac.mm:
        (WebCore::fontCacheATSNotificationCallback): Added. Calls
        FontCache::invalidate().
        (WebCore::FontCache::platformInit): Added code to register for ATS
        notifications.

        * svg/SVGFontFaceElement.cpp: Removed unneeded #inlcudes.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@35025 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/css/CSSFontSelector.cpp
WebCore/css/CSSFontSelector.h
WebCore/platform/graphics/Font.cpp
WebCore/platform/graphics/FontCache.cpp
WebCore/platform/graphics/FontCache.h
WebCore/platform/graphics/FontFallbackList.cpp
WebCore/platform/graphics/FontFallbackList.h
WebCore/platform/graphics/FontSelector.h
WebCore/platform/graphics/mac/FontCacheMac.mm
WebCore/svg/SVGFontFaceElement.cpp