angler-fishThe Vulnerability History Project

2008-10-16 David Hyatt <hyatt@apple.com>

      https://bugs.webkit.org/attachment.cgi?bugid=21647

        Make RenderStyle inherit from RefCounted so that it works with RefPtr.  RenderStyle was being malloced
        out of the RenderArena.  Years and years ago (before TCMalloc), the plan was to make RenderStyles and
        all their associated sub-structs use the arena.  However only the RenderStyle itself was ever changed
        to use the arena.

        At a later point style sharing was implemented, which made using the arena for styles pretty pointless,
        as the bulk of the styles on a given page are actually shared.  Not ever making the sub-structs use the
        arena also limited the usefulness.

        Now that we have RefPtr/PassRefPtr to eliminate manual ref/deref and now that we use TCMalloc for fast
        mallocs, there is no reason to keep RenderStyles in the arena.  The benefits of being able to eliminate
        manual ref/deref far outweigh keeping them in the arena.

        Reviewed by Adam Roben

        * css/CSSStyleSelector.cpp:
        (WebCore::CSSStyleSelector::CSSStyleSelector):
        (WebCore::CSSStyleSelector::~CSSStyleSelector):
        (WebCore::CSSStyleSelector::styleForElement):
        (WebCore::CSSStyleSelector::keyframeStylesForAnimation):
        (WebCore::CSSStyleSelector::pseudoStyleForElement):
        These methods now return a PassRefPtr.  They will null out the m_style variable as they hand it back
        so that it isn't left pointing to the previous style resolve RenderStyle (which is what the old code did).

        (WebCore::CSSStyleSelector::updateFont):
        (WebCore::CSSStyleSelector::checkSelector):
        (WebCore::CSSStyleSelector::applyProperty):
        (WebCore::CSSStyleSelector::mapFillSize):
        (WebCore::CSSStyleSelector::mapFillXPosition):
        (WebCore::CSSStyleSelector::mapFillYPosition):
        * css/CSSStyleSelector.h:
        (WebCore::CSSStyleSelector::style):
    
commit 9f6f5a8218bff29ab45b497e252302fe0a4f024f
-197
+6 -6
+73 -57
+5 -7
+1 -1
+2 -2
+19 -11
+10 -6
+1 -1
+6 -2
+14 -11
+2 -2
+6 -2
+16 -5
+2 -2
+16 -5
+2 -2
+1 -1
+5 -3
+1 -3
+10 -10
+1 -1
+25 -10
+6 -6
+23 -15
+5 -5
+1 -1
+3 -3
+8 -8
+7 -7
+7 -7
+1 -1
+1 -1
+1 -1
+2 -2
+6 -6
+4 -2
+4 -4
+44 -38
+7 -10
+6 -6
+1 -1
+9 -4
+1 -1
+14 -11
+1 -1
+2 -2
+2 -2
+2 -2
+43 -29
+4 -4
+2 -2
+1 -1
+17 -9
+5 -8
+53 -29
+30 -12
+4 -2
+7 -2
+7 -3
+1 -1
+11 -6
expand_less