Bug 77745

Summary: Shareable stylesheet data structures
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: dacarson, eric, kling
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 95219, 76827, 76848, 76904, 77299, 77421, 77460, 77475, 77545, 77621, 77700, 77740, 77779, 78257, 78406, 78452, 78589, 78662, 79092, 79763, 79910, 82127, 82149, 82242, 82332, 82384, 82490, 82728, 82774, 82832, 82847, 83426, 83612, 83998, 84632, 84716, 84752, 84882, 84956, 84969, 85004, 85598, 94926    
Bug Blocks:    

Description Antti Koivisto 2012-02-03 09:26:53 PST
To improve performance and save memory we should make stylesheet data structures cacheable in the memory cache and shareable between documents.
Comment 1 Antti Koivisto 2012-02-03 09:41:00 PST
<rdar://problem/10217321>
Comment 2 Antti Koivisto 2012-02-03 09:43:01 PST
Related bunch of recent bugs towards this goal.
Comment 3 Eric Seidel (no email) 2012-04-15 21:03:49 PDT
Interesting.  I'm attempting to "share" stylesheets between documents for <iframe seamless>:
https://github.com/eseidel/webkit/compare/master...seamless#L61R423

I wonder if I'm getting myself in trouble. :)
Comment 4 Antti Koivisto 2012-04-16 09:59:00 PDT
(In reply to comment #3)
> Interesting.  I'm attempting to "share" stylesheets between documents for <iframe seamless>:
> https://github.com/eseidel/webkit/compare/master...seamless#L61R423
> 
> I wonder if I'm getting myself in trouble. :)

That is going to be bit tricky. Stylesheets can mutate, the style selectors in the sharing child frames will need to be reset too. They hold raw pointers so this must happen synchronously.

Should still be doable.
Comment 5 Eric Seidel (no email) 2012-04-16 14:06:02 PDT
(In reply to comment #4)
> (In reply to comment #3)
> > Interesting.  I'm attempting to "share" stylesheets between documents for <iframe seamless>:
> > https://github.com/eseidel/webkit/compare/master...seamless#L61R423
> > 
> > I wonder if I'm getting myself in trouble. :)
> 
> That is going to be bit tricky. Stylesheets can mutate, the style selectors in the sharing child frames will need to be reset too. They hold raw pointers so this must happen synchronously.
> 
> Should still be doable.

Yes, I need to find wherver the CSSStyleSelector is reset on the parent(s) and make sure all seamless iframe documents also recalc their selectors at that time.  If you have suggestions for specific methods I should hack into, I'm all ears (we can also discuss this on a different bug).