Bug 1446588. Remove the WRUserDatas when document changes Window. r=kats draft
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Tue, 20 Mar 2018 16:35:12 -0400
changeset 770145 dfe87324607c2571f6289b1945ae1b4626521694
parent 770144 2adda34a5051e4fd5bedbac021c3a712125a43af
child 770155 ac470526268f8f90243e9a814f0cfee03e7e1d4e
push id103346
push userbmo:jmuizelaar@mozilla.com
push dateTue, 20 Mar 2018 20:44:13 +0000
reviewerskats
bugs1446588
milestone61.0a1
Bug 1446588. Remove the WRUserDatas when document changes Window. r=kats We can have our LayerManager changed on us when document changes window. (Tab drag, dev tools pop-out). We need to make sure we clear our WebRenderUserData in that case. This hooks into the existing mechanism that does this for DisplayItemData. MozReview-Commit-ID: 8aoOBGOP5Wx
layout/painting/FrameLayerBuilder.cpp
--- a/layout/painting/FrameLayerBuilder.cpp
+++ b/layout/painting/FrameLayerBuilder.cpp
@@ -416,16 +416,17 @@ public:
   bool mInvalidateAllLayers;
 };
 
 /* static */ void
 FrameLayerBuilder::DestroyDisplayItemDataFor(nsIFrame* aFrame)
 {
   RemoveFrameFromLayerManager(aFrame, aFrame->DisplayItemData());
   aFrame->DisplayItemData().Clear();
+  aFrame->DeleteProperty(WebRenderUserDataProperty::Key());
 }
 
 /**
  * We keep a stack of these to represent the PaintedLayers that are
  * currently available to have display items added to.
  * We use a stack here because as much as possible we want to
  * assign display items to existing PaintedLayers, and to the lowest
  * PaintedLayer in z-order. This reduces the number of layers and