Bug 1158798 - [e10s] If mouse is plugged in, inline scrollbars are not used even if OS X is configured for them
Heeeeere we go. This is very similar to bug 1096093.

Here's the synthesis of the problem in that bug:

"So, conclusion: In single-process Firefox, we construct the DOM, and meanwhile, the operating system is asynchronously figuring out about the preferred scrollbar state. But we initially assume overlay scrollbars. As soon as the change occurs, nsChildView.mm hears about it in scrollbarSystemMetricChanged, and we do a NotifyThemeChanged to queue a ThemeChange flush. And meanwhile, the LookAndFeel for UseOverlayScrollbars has changed for everybody reading it.

In the multi-process case, the UseOverlayScrollbars metric changes, but the child never hears about the scrollbarSystemMetricChanged event. So it never does a ThemeChanged on the nsPresContext. "

So, hypothesis: the UseOverlayScrollbars metric is changing but the child is not being informed about it at start-up.

Test: I'll add breakpoints in two places: nsChildView::scrollbarSystemMetricChanged and TabParent::ThemeChanged. In the child, TabChild::RecvThemeChanged and nsLookAndFeel::SetIntCacheImpl.

It doesn't look like the parent is sending the initial change on the scrollbar metric. Interesting.

So from logging, it looks like this is some silliness on my part.

Here's the sequence of events:

Parent starts up. After a while, it hears about the scrollbar metric changing. It updates its internal notion of whether or not to use overlay scrollbars.

A while later, the child starts up, and asks the parents for the look and feel cache...

But the cache is a nsTArray<LookAndFeelInt> with no elements… what the hell? I definitely watched the values get put into that array. I probably did it wrong. :(

And yet… sending theme changes works. So I can use that as a model.

Ahhhhhhhhhhhhh I'm an idiot.

In PContent.ipdl:

sync GetLookAndFeelCache(LookAndFeelInt[] lookAndFeelIntCache);

This is NOT the way to get an array of data from the parent! This is how we _pass_ data to the parent. The lookAndFeelIntCache should be a return value from the parent!

Oh jeebus. Well, at least this should be a straight-forward fix.

Ok, patch written, tests appear to work. Let's get this puppy on try.