-
aroben@apple.com authored
There might be a secret extra sublayer (the tile parent layer) that PlatformCALayer doesn't know about. When PlatformCALayer would encounter this, it would try to use the tile parent layer's PlatformCALayer wrapper, which was null, and then would crash. We now ask PlatformCALayerWinInternal for the sublayer list, since that class knows about the tile parent layer and can exclude it from the sublayer list. Covered by compositing/tiling/huge-layer-resize.html. Fixes <http://webkit.org/b/52597> Crash beneath PlatformCALayer::adoptSublayers when switching out of tiling mode (null-dereference of a PlatformCALayer) Reviewed by Darin Adler and Chris Marrin. LayoutTests: Make compositing/tiling/huge-layer-resize.html faster, more reliable, and more crashy (when there's a WebKit bug) This test was trying to cause a layout/paint to happen by returning to the event loop for a certain amount of time via setTimeout. But this didn't always result in a layout/paint (at least on Windows). We now force the layout/paint explicitly, which also lets us speed up the test by removing the setTimeouts. * compositing/tiling/huge-layer-resize.html: (testOnLoad): Changed to use recordLayerTree, which forces a layout/paint, instead of hoping that setTimeout will do the trick. (recordLayerTree): Forces a layout/paint, then dumps the layer tree. Source/WebCore: * platform/graphics/ca/win/PlatformCALayerWin.cpp: (PlatformCALayer::adoptSublayers): (printLayer): Changed to use PlatformCALayerWinInternal::getSublayers. * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp: (PlatformCALayerWinInternal::getSublayers): Added. Retrieves the list of PlatformCALayers that represent our sublayers. Significantly, this code knows about the tile parent layer and can thus exclude it. * platform/graphics/ca/win/PlatformCALayerWinInternal.h: Added getSublayers. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75985 268f45cc-cd09-0410-ab3c-d52691b4dbfc
7317c459