Bug 49762

Summary: Stylesheet wrappers are not GC protected
Product: WebKit Reporter: Alexey Proskuryakov <ap>
Component: CSSAssignee: Alexey Proskuryakov <ap>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, eric, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
proposed fix ggaren: review+

Description Alexey Proskuryakov 2010-11-18 14:59:23 PST
Custom properties on a stylesheet don't persist, unless an explicit reference to it is kept.
Comment 1 Alexey Proskuryakov 2010-11-18 15:27:48 PST
Created attachment 74303 [details]
proposed fix
Comment 2 Geoffrey Garen 2010-11-18 15:39:36 PST
Comment on attachment 74303 [details]
proposed fix

From a GC footprint perspective, the approach here isn't ideal, since, as you say in your FIXME, we might artificially keep alive style wrappers we could have thrown away.

However, I expect that the set of all style-related DOM nodes in a document is quite small in practice -- and often these nodes aren't even wrapped by JS -- so in these cases I think this approach is fine.
Comment 3 Alexey Proskuryakov 2010-11-18 16:24:22 PST
Committed <http://trac.webkit.org/changeset/72344>.
Comment 4 WebKit Review Bot 2010-11-18 17:14:10 PST
http://trac.webkit.org/changeset/72344 might have broken SnowLeopard Intel Release (Tests)
The following tests are not passing:
fast/dom/prototype-inheritance-2.html
Comment 5 Alexey Proskuryakov 2010-11-18 19:04:17 PST
A subtest changed from FAIL to PASS there. Probably for a good reason, but maybe not, hard to tell with those mega-tests.