2009-07-01 Simon Fraser <simon.fraser@apple.com>
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Jul 2009 05:13:50 +0000 (05:13 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Jul 2009 05:13:50 +0000 (05:13 +0000)
        Reviewed by Dan Bernstein

        <rdar://problem/7026010> <video> fails to show on http://camendesign.com/code/video_for_everybody

        First part of fix: when outline width changes, don't to a synchronous
        layer update right away, but just set the flag to say that compositing
        layers need updating. The synchronous layer update left the layer geometries
        out of whack when it happened in the middle of layout (e.g. when inside ::first-letter).

        Test: compositing/geometry/outline-change.html

        * rendering/RenderView.cpp:
        (WebCore::RenderView::setMaximalOutlineSize):

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

LayoutTests/ChangeLog
LayoutTests/compositing/geometry/outline-change.html [new file with mode: 0644]
LayoutTests/platform/mac/compositing/geometry/outline-change-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/compositing/geometry/outline-change-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/compositing/geometry/outline-change-expected.txt [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/RenderView.cpp

index 92d8be6..0356f3b 100644 (file)
@@ -1,3 +1,16 @@
+2009-07-01  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Dan Bernstein
+        
+        <rdar://problem/7026010> <video> fails to show on http://camendesign.com/code/video_for_everybody
+
+        Test for outline width affecting compositing layer positions.
+        
+        * compositing/geometry/outline-change.html: Added.
+        * platform/mac/compositing/geometry/outline-change-expected.checksum: Added.
+        * platform/mac/compositing/geometry/outline-change-expected.png: Added.
+        * platform/mac/compositing/geometry/outline-change-expected.txt: Added.
+
 2009-07-01  Daniel Bates  <dbates@intudata.com>
 
         Reviewed by Adam Barth.
diff --git a/LayoutTests/compositing/geometry/outline-change.html b/LayoutTests/compositing/geometry/outline-change.html
new file mode 100644 (file)
index 0000000..985d3c6
--- /dev/null
@@ -0,0 +1,59 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+   "http://www.w3.org/TR/html4/loose.dtd">
+
+<html lang="en">
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+  <title>untitled</title>
+  <style type="text/css" media="screen">
+
+    #container {
+      position: relative;
+      height: 100px;
+      width: 100px;
+      margin: 50px;
+      border: 1px solid black;
+      -webkit-transform: translateZ(0);
+    }
+    
+    #outer {
+      position: absolute;
+      left: -25px;
+      top: -25px;
+      height: 50px;
+      width: 50px;
+      border: 1px solid blue;
+    }
+    
+    #tester {
+      width: 10px;
+      height: 10px;
+    }
+    
+  </style>
+  <script type="text/javascript" charset="utf-8">
+    if (window.layoutTestController)
+      layoutTestController.waitUntilDone();
+    
+    function test()
+    {
+      window.setTimeout(function() {
+        document.getElementById('tester').style.outline = '5px solid green';
+        if (window.layoutTestController)
+          layoutTestController.notifyDone();
+      }, 0);
+    }
+    window.addEventListener('load', test, false);
+  </script>
+</head>
+<body>
+
+<p>Adding outline should not affect layer positions</p>
+<div id="container">
+  <div id="outer"></div>
+</div>
+<div id="tester">
+</div>
+
+</body>
+</html>
diff --git a/LayoutTests/platform/mac/compositing/geometry/outline-change-expected.checksum b/LayoutTests/platform/mac/compositing/geometry/outline-change-expected.checksum
new file mode 100644 (file)
index 0000000..d072e28
--- /dev/null
@@ -0,0 +1 @@
+a5165530aca8dd3c1b7c8a10bf40d810
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/compositing/geometry/outline-change-expected.png b/LayoutTests/platform/mac/compositing/geometry/outline-change-expected.png
new file mode 100644 (file)
index 0000000..b00d2a5
Binary files /dev/null and b/LayoutTests/platform/mac/compositing/geometry/outline-change-expected.png differ
diff --git a/LayoutTests/platform/mac/compositing/geometry/outline-change-expected.txt b/LayoutTests/platform/mac/compositing/geometry/outline-change-expected.txt
new file mode 100644 (file)
index 0000000..0d70a5c
--- /dev/null
@@ -0,0 +1,13 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x254
+  RenderBlock {HTML} at (0,0) size 800x254
+    RenderBody {BODY} at (8,16) size 784x230
+      RenderBlock {P} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 299x18
+          text run at (0,0) width 299: "Adding outline should not affect layer positions"
+      RenderBlock {DIV} at (0,220) size 10x10
+layer at (58,84) size 102x102
+  RenderBlock (relative positioned) {DIV} at (50,68) size 102x102 [border: (1px solid #000000)]
+layer at (34,60) size 52x52
+  RenderBlock (positioned) {DIV} at (-24,-24) size 52x52 [border: (1px solid #0000FF)]
index 3107519..87940bf 100644 (file)
@@ -1,3 +1,19 @@
+2009-07-01  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Dan Bernstein
+        
+        <rdar://problem/7026010> <video> fails to show on http://camendesign.com/code/video_for_everybody
+
+        First part of fix: when outline width changes, don't to a synchronous
+        layer update right away, but just set the flag to say that compositing
+        layers need updating. The synchronous layer update left the layer geometries
+        out of whack when it happened in the middle of layout (e.g. when inside ::first-letter).
+        
+        Test: compositing/geometry/outline-change.html
+
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::setMaximalOutlineSize):
+
 2009-07-01  Kwang Yul Seo  <skyul@company100.net>
 
         Reviewed by Eric Seidel.
index 05d40bc..0372fdd 100644 (file)
@@ -343,8 +343,8 @@ void RenderView::setMaximalOutlineSize(int o)
     if (o != m_maximalOutlineSize) {
         m_maximalOutlineSize = o;
 
-        if (m_frameView)
-            m_frameView->updateCompositingLayers(FrameView::ForcedCompositingUpdate);
+        // maximalOutlineSize affects compositing layer dimensions.
+        compositor()->setCompositingLayersNeedUpdate();
     }
 }
 #endif