WebCore:
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Jul 2009 23:45:45 +0000 (23:45 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Jul 2009 23:45:45 +0000 (23:45 +0000)
commitb0915f0fa4407b9cdb471fe5174fbe5a2f24704d
tree44a0759c525584eca188eea63187f9be319f3f0c
parent5f0ccbc884c2acea00510549e24637d7e009ed2f
WebCore:

        Reviewed by Dave Hyatt and Darin Adler.

        - fix https://bugs.webkit.org/show_bug.cgi?id=26963
          <rdar://problem/7030998> Reproducible crash at
          FontCache::getFontData() when a custom font is used in a pseudo-style

        Test: fast/css/pseudo-cache-stale.html

        * dom/Element.cpp:
        (WebCore::Element::pseudoStyleCacheIsInvalid): Added. Given the old
        style and the new style, goes over cached pseudo-styles in the old
        style and re-resolves the same style types off the new style. If any of
        the new pseudo-styles is different from the currently cached
        corresponding style, returns true. Otherwise, returns false.
        (WebCore::Element::recalcStyle): Validate the pseudo-style cache before
        deciding to keep the existing style.
        * dom/Element.h:
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::uncachedFirstLineStyle): Added this version that
        returns an uncached first-line style based off the given style.
        (WebCore::RenderObject::getUncachedPseudoStyle): Added the 'ownStyle'
        parameter.
        * rendering/RenderObject.h:
        * rendering/style/RenderStyle.cpp:
        (WebCore::RenderStyle::getPseudoStyleCache): Added. Returns the cached
        pseudo-styles in the passed-in vector.
        * rendering/style/RenderStyle.h:

LayoutTests:

        Reviewed by Dave Hyatt and Darin Adler.

        - test for https://bugs.webkit.org/show_bug.cgi?id=26963
          <rdar://problem/7030998> Reproducible crash at
          FontCache::getFontData() when a custom font is used in a pseudo-style

        * fast/css/pseudo-cache-stale.html: Added.
        * platform/mac/fast/css/pseudo-cache-stale-expected.checksum: Added.
        * platform/mac/fast/css/pseudo-cache-stale-expected.png: Added.
        * platform/mac/fast/css/pseudo-cache-stale-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@45612 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/pseudo-cache-stale.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/css/pseudo-cache-stale-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/fast/css/pseudo-cache-stale-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/css/pseudo-cache-stale-expected.txt [new file with mode: 0644]
WebCore/ChangeLog
WebCore/dom/Element.cpp
WebCore/dom/Element.h
WebCore/rendering/RenderObject.cpp
WebCore/rendering/RenderObject.h
WebCore/rendering/style/RenderStyle.cpp
WebCore/rendering/style/RenderStyle.h