A recently added assertion discovered a bug where our dependence on undefined behavior in CA was causing the layer tree to get into a bad state. We depend on adding a sublayer which already has a parent to another layer, the sublayer is first removed from its parent layer. CA headers say this is undefined behavior (that layers should always have a nil superlayer when being added as a sublayer), but we heavily depend on it being the case. Most of PlatformCALayerRemote behaved correctly, but setSublayers() failed to unparent the incoming layers.
Created attachment 215533 [details] patch
Created attachment 215542 [details] no reason not to fold it into the existing loop
http://trac.webkit.org/changeset/158297