Fix crash introduced in r175656
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Nov 2014 06:07:06 +0000 (06:07 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Nov 2014 06:07:06 +0000 (06:07 +0000)
https://bugs.webkit.org/show_bug.cgi?id=138453

Reviewed by Dan Bernstein.

repaintContainer can be null sometimes.

Covered by existing tests.

* rendering/RenderLayerCompositor.cpp:
(WebCore::styleChangeRequiresLayerRebuild):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@175679 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayerCompositor.cpp

index a54f5cf..100b533 100644 (file)
@@ -1,3 +1,17 @@
+2014-11-05  Simon Fraser  <simon.fraser@apple.com>
+
+        Fix crash introduced in r175656
+        https://bugs.webkit.org/show_bug.cgi?id=138453
+
+        Reviewed by Dan Bernstein.
+
+        repaintContainer can be null sometimes.
+        
+        Covered by existing tests.
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::styleChangeRequiresLayerRebuild):
+
 2014-11-05  Dan Bernstein  <mitz@apple.com>
 
         Tried to fix the Windows build after removing the deletion UI.
index b926ba9..189acdf 100644 (file)
@@ -884,7 +884,7 @@ static bool styleChangeRequiresLayerRebuild(const RenderLayer& layer, const Rend
     // FIXME: need to check everything that we consult to avoid backing store here: webkit.org/b/138383
     if (!oldStyle.opacity() != !newStyle.opacity()) {
         RenderLayerModelObject* repaintContainer = layer.renderer().containerForRepaint();
-        if (RenderLayerBacking* ancestorBacking = repaintContainer->layer()->backing()) {
+        if (RenderLayerBacking* ancestorBacking = repaintContainer ? repaintContainer->layer()->backing() : nullptr) {
             if (newStyle.opacity() != ancestorBacking->graphicsLayer()->drawsContent())
                 return true;
         }