[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da

simon.fraser at apple.com simon.fraser at apple.com
Wed Dec 22 18:38:38 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 107a40fadc364cc72620cdff3b1445d03f592044
Author: simon.fraser at apple.com <simon.fraser at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Dec 15 01:52:31 2010 +0000

    2010-12-14  Simon Fraser  <simon.fraser at apple.com>
    
            Reviewed by Chris Marrin.
    
            Parts of page disappear
            https://bugs.webkit.org/show_bug.cgi?id=41701
    
            The page has text-indent: -1000000px on an element that becomes
            compositing, causing a huge tiled layer to get created.
    
            r63452 aimed to fix this by clamping layer bounds to the viewport,
            but did not do so for pages running accelerated animations (since
            we don't want to clamp for transform animations). However, this
            page only has an opacity animation.
    
            So refine the logic added for r63452 to only call setCompositingConsultsOverlap(false)
            for transform animations.
    
            Test: compositing/geometry/limit-layer-bounds-opacity-transition.html
    
            * rendering/RenderLayerBacking.cpp:
            (WebCore::RenderLayerBacking::startAnimation): call didStartAcceleratedAnimation()
            with the appropriate properties, and clean up confusing logic that was used to
            compute the return value. We want to return true if either property is accelerated.
    
            (WebCore::RenderLayerBacking::startTransition): Call didStartAcceleratedAnimation()
            with the appropriate property.
    
            * rendering/RenderLayerCompositor.h:
            * rendering/RenderLayerCompositor.cpp:
            (WebCore::RenderLayerCompositor::didStartAcceleratedAnimation): Pass the property in,
            and only turn off overlap testing if we see a transform animation.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74085 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index d43047b..7a00d6c 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2010-12-14  Simon Fraser  <simon.fraser at apple.com>
+
+        Reviewed by Chris Marrin.
+
+        Parts of page disappear
+        https://bugs.webkit.org/show_bug.cgi?id=41701
+        
+        Testcase for clipping to view bounds even when an accelerated opacity
+        transition runs.
+
+        * compositing/geometry/limit-layer-bounds-opacity-transition-expected.txt: Added.
+        * compositing/geometry/limit-layer-bounds-opacity-transition.html: Added.
+
 2010-12-14  Brady Eidson  <beidson at apple.com>
 
         Reviewed by Alexey Proskuryakov.
diff --git a/LayoutTests/compositing/geometry/limit-layer-bounds-opacity-transition-expected.txt b/LayoutTests/compositing/geometry/limit-layer-bounds-opacity-transition-expected.txt
new file mode 100644
index 0000000..2882487
--- /dev/null
+++ b/LayoutTests/compositing/geometry/limit-layer-bounds-opacity-transition-expected.txt
@@ -0,0 +1,22 @@
+Test
+Fader
+(GraphicsLayer
+  (bounds 800.00 600.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (children 2
+        (GraphicsLayer
+          (position 8.00 8.00)
+          (bounds 352.00 288.00)
+        )
+        (GraphicsLayer
+          (position 0.00 290.00)
+          (bounds 108.00 100.00)
+          (drawsContent 1)
+        )
+      )
+    )
+  )
+)
+
diff --git a/LayoutTests/compositing/geometry/limit-layer-bounds-opacity-transition.html b/LayoutTests/compositing/geometry/limit-layer-bounds-opacity-transition.html
new file mode 100644
index 0000000..ffe842d
--- /dev/null
+++ b/LayoutTests/compositing/geometry/limit-layer-bounds-opacity-transition.html
@@ -0,0 +1,64 @@
+<!DOCTYPE html>
+
+<html>
+  <style type="text/css" media="screen">
+    .test {
+      position: relative;
+      top: -10px; /* overlap video */
+      width: 100px;
+      height: 100px;
+      background-color: white;
+      text-indent: -10000px;
+    }
+    
+    #fading {
+      opacity: 0;
+      -webkit-transition: opacity 0.1s;
+    }
+  </style>
+  <script type="text/javascript" charset="utf-8">
+    if (window.layoutTestController) {
+      layoutTestController.waitUntilDone();
+      layoutTestController.dumpAsText();
+    }
+
+    function startFade()
+    {
+      // At the end of this fade we are interested in the size of .test in the layer dump.
+      // It should be constrained to the size of the view, so not tiled.
+      var fader = document.getElementById('fading');
+      fader.addEventListener('webkitTransitionEnd', fadeDone, false);
+      document.getElementById('fading').style.opacity = 1;
+    }
+    
+    function fadeDone()
+    {
+      if (window.layoutTestController) {
+        document.getElementById('layers').innerText = layoutTestController.layerTreeAsText();
+        layoutTestController.notifyDone();
+      }
+    }
+  </script>
+<head>
+</head>
+<body>
+
+  <!-- Go into compositing without transforms. -->
+  <video src="../resources/video.mp4"></video>
+
+  <div class="test">
+    Test
+  </div>
+  
+  <div id="fading">
+    Fader
+  </div>
+
+  <pre id="layers">Layer tree goes here in DRT</pre>
+  <script>
+    // Wait for video to load to get compositing before the fade.
+    var video = document.getElementsByTagName('video')[0];
+    video.addEventListener('canplaythrough', startFade, false);
+  </script>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 4264e6e..25f6cc9 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,36 @@
+2010-12-14  Simon Fraser  <simon.fraser at apple.com>
+
+        Reviewed by Chris Marrin.
+
+        Parts of page disappear
+        https://bugs.webkit.org/show_bug.cgi?id=41701
+        
+        The page has text-indent: -1000000px on an element that becomes
+        compositing, causing a huge tiled layer to get created.
+        
+        r63452 aimed to fix this by clamping layer bounds to the viewport,
+        but did not do so for pages running accelerated animations (since
+        we don't want to clamp for transform animations). However, this
+        page only has an opacity animation.
+        
+        So refine the logic added for r63452 to only call setCompositingConsultsOverlap(false)
+        for transform animations.
+
+        Test: compositing/geometry/limit-layer-bounds-opacity-transition.html
+
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::startAnimation): call didStartAcceleratedAnimation()
+        with the appropriate properties, and clean up confusing logic that was used to
+        compute the return value. We want to return true if either property is accelerated.
+
+        (WebCore::RenderLayerBacking::startTransition): Call didStartAcceleratedAnimation()
+        with the appropriate property.
+        
+        * rendering/RenderLayerCompositor.h:
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::didStartAcceleratedAnimation): Pass the property in,
+        and only turn off overlap testing if we see a transform animation.
+
 2010-12-14  Brady Eidson  <beidson at apple.com>
 
         Reviewed by Alexey Proskuryakov.
diff --git a/WebCore/rendering/RenderLayerBacking.cpp b/WebCore/rendering/RenderLayerBacking.cpp
index baa68a5..0a32eda 100644
--- a/WebCore/rendering/RenderLayerBacking.cpp
+++ b/WebCore/rendering/RenderLayerBacking.cpp
@@ -1140,20 +1140,20 @@ bool RenderLayerBacking::startAnimation(double timeOffset, const Animation* anim
             opacityVector.insert(new FloatAnimationValue(key, keyframeStyle->opacity(), tf));
     }
 
-    bool didAnimateTransform = !hasTransform;
-    bool didAnimateOpacity = !hasOpacity;
+    bool didAnimateTransform = false;
+    bool didAnimateOpacity = false;
     
-    if (hasTransform && m_graphicsLayer->addAnimation(transformVector, toRenderBox(renderer())->borderBoxRect().size(), anim, keyframes.animationName(), timeOffset))
+    if (hasTransform && m_graphicsLayer->addAnimation(transformVector, toRenderBox(renderer())->borderBoxRect().size(), anim, keyframes.animationName(), timeOffset)) {
         didAnimateTransform = true;
+        compositor()->didStartAcceleratedAnimation(CSSPropertyWebkitTransform);
+    }
 
-    if (hasOpacity && m_graphicsLayer->addAnimation(opacityVector, IntSize(), anim, keyframes.animationName(), timeOffset))
+    if (hasOpacity && m_graphicsLayer->addAnimation(opacityVector, IntSize(), anim, keyframes.animationName(), timeOffset)) {
         didAnimateOpacity = true;
-    
-    bool runningAcceleratedAnimation = didAnimateTransform && didAnimateOpacity;
-    if (runningAcceleratedAnimation)
-        compositor()->didStartAcceleratedAnimation();
+        compositor()->didStartAcceleratedAnimation(CSSPropertyOpacity);
+    }
 
-    return runningAcceleratedAnimation;
+    return didAnimateTransform || didAnimateOpacity;
 }
 
 void RenderLayerBacking::animationPaused(double timeOffset, const String& animationName)
@@ -1168,7 +1168,8 @@ void RenderLayerBacking::animationFinished(const String& animationName)
 
 bool RenderLayerBacking::startTransition(double timeOffset, int property, const RenderStyle* fromStyle, const RenderStyle* toStyle)
 {
-    bool didAnimate = false;
+    bool didAnimateOpacity = false;
+    bool didAnimateTransform = false;
     ASSERT(property != cAnimateAll);
 
     if (property == (int)CSSPropertyOpacity) {
@@ -1181,7 +1182,7 @@ bool RenderLayerBacking::startTransition(double timeOffset, int property, const
             if (m_graphicsLayer->addAnimation(opacityVector, IntSize(), opacityAnim, GraphicsLayer::animationNameForTransition(AnimatedPropertyOpacity), timeOffset)) {
                 // To ensure that the correct opacity is visible when the animation ends, also set the final opacity.
                 updateLayerOpacity(toStyle);
-                didAnimate = true;
+                didAnimateOpacity = true;
             }
         }
     }
@@ -1195,15 +1196,18 @@ bool RenderLayerBacking::startTransition(double timeOffset, int property, const
             if (m_graphicsLayer->addAnimation(transformVector, toRenderBox(renderer())->borderBoxRect().size(), transformAnim, GraphicsLayer::animationNameForTransition(AnimatedPropertyWebkitTransform), timeOffset)) {
                 // To ensure that the correct transform is visible when the animation ends, also set the final opacity.
                 updateLayerTransform(toStyle);
-                didAnimate = true;
+                didAnimateTransform = true;
             }
         }
     }
 
-    if (didAnimate)
-        compositor()->didStartAcceleratedAnimation();
+    if (didAnimateOpacity)
+        compositor()->didStartAcceleratedAnimation(CSSPropertyOpacity);
+
+    if (didAnimateTransform)
+        compositor()->didStartAcceleratedAnimation(CSSPropertyWebkitTransform);
     
-    return didAnimate;
+    return didAnimateOpacity || didAnimateTransform;
 }
 
 void RenderLayerBacking::transitionPaused(double timeOffset, int property)
diff --git a/WebCore/rendering/RenderLayerCompositor.cpp b/WebCore/rendering/RenderLayerCompositor.cpp
index e006aed..c6935f6 100644
--- a/WebCore/rendering/RenderLayerCompositor.cpp
+++ b/WebCore/rendering/RenderLayerCompositor.cpp
@@ -1063,12 +1063,13 @@ void RenderLayerCompositor::updateRootLayerPosition()
         m_rootPlatformLayer->setSize(FloatSize(m_renderView->rightLayoutOverflow(), m_renderView->bottomLayoutOverflow()));
 }
 
-void RenderLayerCompositor::didStartAcceleratedAnimation()
+void RenderLayerCompositor::didStartAcceleratedAnimation(CSSPropertyID property)
 {
     // If an accelerated animation or transition runs, we have to turn off overlap checking because
     // we don't do layout for every frame, but we have to ensure that the layering is
     // correct between the animating object and other objects on the page.
-    setCompositingConsultsOverlap(false);
+    if (property == CSSPropertyWebkitTransform)
+        setCompositingConsultsOverlap(false);
 }
 
 bool RenderLayerCompositor::has3DContent() const
diff --git a/WebCore/rendering/RenderLayerCompositor.h b/WebCore/rendering/RenderLayerCompositor.h
index f7e4ffa..06c0bcd 100644
--- a/WebCore/rendering/RenderLayerCompositor.h
+++ b/WebCore/rendering/RenderLayerCompositor.h
@@ -143,7 +143,7 @@ public:
     void didMoveOnscreen();
     void willMoveOffscreen();
     
-    void didStartAcceleratedAnimation();
+    void didStartAcceleratedAnimation(CSSPropertyID);
     
 #if ENABLE(VIDEO)
     // Use by RenderVideo to ask if it should try to use accelerated compositing.

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list