Bug 78406

Summary: Move CSSOM wrapper pointer out of StylePropertySet
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: kling, macpherson, menard, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 77745    
Attachments:
Description Flags
patch kling: review+, kling: commit-queue-

Description Antti Koivisto 2012-02-10 18:51:09 PST
...to a global HashMap.
Comment 1 Antti Koivisto 2012-02-10 23:04:24 PST
Created attachment 126620 [details]
patch
Comment 2 Andreas Kling 2012-02-10 23:33:15 PST
Comment on attachment 126620 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=126620&action=review

r=me with one fix:

> Source/WebCore/css/StylePropertySet.cpp:49
> +static PropertySetCSSOMWrapperMap* propertySetCSSOMWrapperMap;

This pointer needs to be explicitly initialized.
Also, a common pattern in WebKit is to write these like so:

static PropertySetCSSOMWrapperMap& propertySetCSSOMWrapperMap()
{
    DEFINE_STATIC_LOCAL(PropertySetCSSOMWrapperMap, derp, ());
    return derp;
}
Comment 3 Andreas Kling 2012-02-10 23:39:17 PST
(In reply to comment #2)
> (From update of attachment 126620 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=126620&action=review
> 
> r=me with one fix:
> 
> > Source/WebCore/css/StylePropertySet.cpp:49
> > +static PropertySetCSSOMWrapperMap* propertySetCSSOMWrapperMap;
> 
> This pointer needs to be explicitly initialized.

Disregard this cool story, bro. TIL that static globals are zero-initialized..
Comment 4 Antti Koivisto 2012-02-10 23:52:57 PST
http://trac.webkit.org/changeset/107474

The pattern looks nicer so I did it anyway.