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

bdakin at apple.com bdakin at apple.com
Wed Dec 22 14:48:06 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 3ee4d3ed9c311ec2f78ee2cafeeac1d57f05eb7b
Author: bdakin at apple.com <bdakin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 20 20:38:17 2010 +0000

    WebCore: Fix for https://bugs.webkit.org/show_bug.cgi?id=47514 CSS
    transforms should affect scrolling
    
    Reviewed by Dave Hyatt.
    
    This patch causes topmostPosition, lowestPosition,
    leftmostPosition, and rightmostPosition to take transforms into
    account.
    
    Compute the topmost/lowest/leftmost/rightmost position without
    factoring in the block's transform until the end.
    * rendering/RenderBlock.cpp:
    (WebCore::RenderBlock::topmostPosition):
    (WebCore::RenderBlock::lowestPosition):
    (WebCore::RenderBlock::rightmostPosition):
    (WebCore::RenderBlock::leftmostPosition):
    * rendering/RenderBlock.h:
    
    transformedFrameRect() returns the frameRect() transformed to the
    layer's transform. applyLayerTransformToRect() does the same thing
    for the input rect.
    * rendering/RenderBox.cpp:
    (WebCore::RenderBox::applyLayerTransformToRect):
    (WebCore::RenderBox::transformedFrameRect):
    (WebCore::RenderBox::topmostPosition):
    (WebCore::RenderBox::lowestPosition):
    (WebCore::RenderBox::rightmostPosition):
    (WebCore::RenderBox::leftmostPosition):
    * rendering/RenderBox.h:
    * rendering/RenderMedia.cpp:
    (WebCore::RenderMedia::topmostPosition):
    (WebCore::RenderMedia::lowestPosition):
    (WebCore::RenderMedia::rightmostPosition):
    (WebCore::RenderMedia::leftmostPosition):
    * rendering/RenderMedia.h:
    * rendering/RenderTableSection.cpp:
    (WebCore::RenderTableSection::topmostPosition):
    (WebCore::RenderTableSection::lowestPosition):
    (WebCore::RenderTableSection::rightmostPosition):
    (WebCore::RenderTableSection::leftmostPosition):
    * rendering/RenderTableSection.h:
    
    LayoutTests: New tests and updated results for https://bugs.webkit.org/show_bug.cgi?id=47514
    CSS transforms should affect scrolling
    
    Reviewed by Dave Hyatt.
    
    New tests.
    * fast/transforms/rotated-transform-affects-scrolling-1.html: Added.
    * fast/transforms/rotated-transform-affects-scrolling-2.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70170 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index cd49d76..3a28670 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,43 @@
+2010-10-20  Beth Dakin  <bdakin at apple.com>
+
+        Reviewed by Dave Hyatt.
+
+        New tests and updated results for https://bugs.webkit.org/show_bug.cgi?id=47514 
+        CSS transforms should affect scrolling
+
+        New tests.
+        * fast/transforms/rotated-transform-affects-scrolling-1.html: Added.
+        * fast/transforms/rotated-transform-affects-scrolling-2.html: Added.
+* fast/transforms/topmost-becomes-bottomost-for-scrolling-expected.txt: Added.
+        * fast/transforms/topmost-becomes-bottomost-for-scrolling.html: Added.
+        * fast/transforms/transform-inside-overflow-scroll-expected.txt: Added.
+        * fast/transforms/transform-inside-overflow-scroll.html: Added.
+        * platform/mac/fast/transforms/rotated-transform-affects-scrolling-1-expected.checksum: Added.
+        * platform/mac/fast/transforms/rotated-transform-affects-scrolling-1-expected.png: Added.
+        * platform/mac/fast/transforms/rotated-transform-affects-scrolling-1-expected.txt: Added.
+        * platform/mac/fast/transforms/rotated-transform-affects-scrolling-2-expected.checksum: Added.
+        * platform/mac/fast/transforms/rotated-transform-affects-scrolling-2-expected.png: Added.
+        * platform/mac/fast/transforms/rotated-transform-affects-scrolling-2-expected.txt: Added.
+
+        Updated tests:
+        * compositing/geometry/limit-layer-bounds-transformed-expected.txt:
+        * fast/transforms/scrollIntoView-transformed-expected.txt:
+        * platform/mac/compositing/geometry/vertical-scroll-composited-expected.checksum:
+        * platform/mac/compositing/geometry/vertical-scroll-composited-expected.png:
+        * platform/mac/compositing/geometry/vertical-scroll-composited-expected.txt:
+        * platform/mac/fast/backgrounds/repeat/negative-offset-repeat-transformed-expected.checksum:
+        * platform/mac/fast/backgrounds/repeat/negative-offset-repeat-transformed-expected.png:
+        * platform/mac/fast/backgrounds/repeat/negative-offset-repeat-transformed-expected.txt:
+        * platform/mac/fast/borders/border-image-rotate-transform-expected.checksum:
+        * platform/mac/fast/borders/border-image-rotate-transform-expected.png:
+        * platform/mac/fast/borders/border-image-rotate-transform-expected.txt:
+        * platform/mac/fast/borders/border-image-scale-transform-expected.checksum:
+        * platform/mac/fast/borders/border-image-scale-transform-expected.png:
+        * platform/mac/fast/borders/border-image-scale-transform-expected.txt:
+        * platform/mac/fast/forms/search-transformed-expected.checksum:
+        * platform/mac/fast/forms/search-transformed-expected.png:
+        * platform/mac/fast/forms/search-transformed-expected.txt:
+
 2010-10-20  Sheriff Bot  <webkit.review.bot at gmail.com>
 
         Unreviewed, rolling out r70151.
diff --git a/LayoutTests/compositing/geometry/limit-layer-bounds-transformed-expected.txt b/LayoutTests/compositing/geometry/limit-layer-bounds-transformed-expected.txt
index 8221ff7..6469010 100644
--- a/LayoutTests/compositing/geometry/limit-layer-bounds-transformed-expected.txt
+++ b/LayoutTests/compositing/geometry/limit-layer-bounds-transformed-expected.txt
@@ -1,9 +1,9 @@
 Text here
 (GraphicsLayer
-  (bounds 800.00 600.00)
+  (bounds 1329.00 585.00)
   (children 1
     (GraphicsLayer
-      (bounds 800.00 600.00)
+      (bounds 1329.00 585.00)
       (children 3
         (GraphicsLayer
           (position 129.00 29.00)
diff --git a/LayoutTests/fast/transforms/rotated-transform-affects-scrolling-1.html b/LayoutTests/fast/transforms/rotated-transform-affects-scrolling-1.html
new file mode 100644
index 0000000..6aeebd9
--- /dev/null
+++ b/LayoutTests/fast/transforms/rotated-transform-affects-scrolling-1.html
@@ -0,0 +1,22 @@
+<html>
+<head>
+<style>
+    #rotate {
+        width: 1300px;
+        height: 100px;
+        background-color: purple;
+        -webkit-transform:rotate(110deg);
+        border-left: 2px solid red;
+        border-top: 2px solid blue;
+        border-right: 2px solid cyan;
+        border-bottom: 2px solid green;
+    }
+</style>
+</head>
+
+<body>
+
+    <div id="rotate"></div>
+
+</body>
+</html>
diff --git a/LayoutTests/fast/transforms/rotated-transform-affects-scrolling-2.html b/LayoutTests/fast/transforms/rotated-transform-affects-scrolling-2.html
new file mode 100644
index 0000000..0f63808
--- /dev/null
+++ b/LayoutTests/fast/transforms/rotated-transform-affects-scrolling-2.html
@@ -0,0 +1,22 @@
+<html>
+<head>
+<style>
+    #rotate {
+        width: 1300px;
+        height: 100px;
+        background-color: purple;
+        -webkit-transform:rotate(80deg);
+        border-left: 2px solid red;
+        border-top: 2px solid blue;
+        border-right: 2px solid cyan;
+        border-bottom: 2px solid green;
+    }
+</style>
+</head>
+
+<body>
+
+    <div id="rotate"></div>
+
+</body>
+</html>
diff --git a/LayoutTests/fast/transforms/scrollIntoView-transformed-expected.txt b/LayoutTests/fast/transforms/scrollIntoView-transformed-expected.txt
index f35d5f9..129334c 100644
--- a/LayoutTests/fast/transforms/scrollIntoView-transformed-expected.txt
+++ b/LayoutTests/fast/transforms/scrollIntoView-transformed-expected.txt
@@ -67,8 +67,8 @@ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
 this is a div scroll trigger with a transform
 PASS - Element a and Element b had different scrollTop
 PASS - Element b had scrollTop: 0
-PASS - Element c and Element c-transformed both had the same scrollTop
-PASS - Element d and Element d-transformed both had the same scrollTop
-PASS - Element e and Element e-transformed both had the same scrollTop
-PASS - Element f and Element f-transformed both had the same scrollTop
+FAIL - Element c had scrollTop: 233 and Element c-transformed had scrollTop: 0
+FAIL - Element d had scrollTop: 221 and Element d-transformed had scrollTop: 0
+FAIL - Element e had scrollTop: 238 and Element e-transformed had scrollTop: 0
+FAIL - Element f had scrollTop: 304 and Element f-transformed had scrollTop: 4
 
diff --git a/LayoutTests/fast/transforms/topmost-becomes-bottomost-for-scrolling-expected.txt b/LayoutTests/fast/transforms/topmost-becomes-bottomost-for-scrolling-expected.txt
new file mode 100644
index 0000000..2d510c3
--- /dev/null
+++ b/LayoutTests/fast/transforms/topmost-becomes-bottomost-for-scrolling-expected.txt
@@ -0,0 +1,3 @@
+SUCCESS! The transform was applied to the scrollHeight!
+
+
diff --git a/LayoutTests/fast/transforms/topmost-becomes-bottomost-for-scrolling.html b/LayoutTests/fast/transforms/topmost-becomes-bottomost-for-scrolling.html
new file mode 100644
index 0000000..8c0f9a1
--- /dev/null
+++ b/LayoutTests/fast/transforms/topmost-becomes-bottomost-for-scrolling.html
@@ -0,0 +1,49 @@
+<html>
+<head>
+<style>
+    #scroll {
+        width: 230px;
+        height: 230px;
+        overflow: scroll;
+        border: 1px solid black;
+    }
+    #container {
+        width:200px;
+        height:200px;
+        background-color:blue;
+        -webkit-transform: rotate(180deg);
+    }
+    #spill {
+        width:100px;
+        height:100px;
+        background-color:green;
+        position:absolute;
+        top:-50px;
+    }
+</style>
+</head>
+
+<body>
+
+    <p id="result">
+        FAIL. The transform has not been applied to the scrollHeight.
+    </p>
+
+    <div id="scroll">
+        <div id="container">
+            <div id="spill"></div>
+        </div>
+    </div>
+
+    <script>
+        if (window.layoutTestController)
+            layoutTestController.dumpAsText();
+        var scroll = document.getElementById("scroll");
+        var scrollHeight = scroll.scrollHeight;
+        if (scrollHeight > 215) {
+            var result = document.getElementById("result");
+            result.innerHTML = "SUCCESS! The transform was applied to the scrollHeight!";
+        }
+    </script>
+</body>
+</html>
diff --git a/LayoutTests/fast/transforms/transform-inside-overflow-scroll-expected.txt b/LayoutTests/fast/transforms/transform-inside-overflow-scroll-expected.txt
new file mode 100644
index 0000000..2d510c3
--- /dev/null
+++ b/LayoutTests/fast/transforms/transform-inside-overflow-scroll-expected.txt
@@ -0,0 +1,3 @@
+SUCCESS! The transform was applied to the scrollHeight!
+
+
diff --git a/LayoutTests/fast/transforms/transform-inside-overflow-scroll.html b/LayoutTests/fast/transforms/transform-inside-overflow-scroll.html
new file mode 100644
index 0000000..eb317c7
--- /dev/null
+++ b/LayoutTests/fast/transforms/transform-inside-overflow-scroll.html
@@ -0,0 +1,41 @@
+<html>
+<head>
+    <style>
+        #scroll {
+            width: 200px;
+            height: 200px;
+            overflow: scroll;
+            border: 1px solid black;
+        }
+        
+        #transform {
+            width: 100px;
+            height: 100px;
+            background-color: green;
+            -webkit-transform: translateY(150px);
+        }
+    </style>
+</head>
+
+<body>
+
+    <p id="result">
+        FAIL. The transform has not been applied to the scrollHeight.
+    </p>
+
+    <div id="scroll">
+        <div id="transform"></div>
+    </div>
+
+    <script>
+        if (window.layoutTestController)
+            layoutTestController.dumpAsText();
+        var scroll = document.getElementById("scroll");
+        var scrollHeight = scroll.scrollHeight;
+        if (scrollHeight > 200) {
+            var result = document.getElementById("result");
+            result.innerHTML = "SUCCESS! The transform was applied to the scrollHeight!";
+        }
+    </script>
+</body>
+</html>
diff --git a/LayoutTests/platform/mac/compositing/geometry/vertical-scroll-composited-expected.checksum b/LayoutTests/platform/mac/compositing/geometry/vertical-scroll-composited-expected.checksum
index 4a5e0e3..e59d867 100644
--- a/LayoutTests/platform/mac/compositing/geometry/vertical-scroll-composited-expected.checksum
+++ b/LayoutTests/platform/mac/compositing/geometry/vertical-scroll-composited-expected.checksum
@@ -1 +1 @@
-f5a5faa98eb7dcc5130c91dd0cdfaaa1
\ No newline at end of file
+2aaeae1a873204b246cbd0f441fc335f
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/compositing/geometry/vertical-scroll-composited-expected.png b/LayoutTests/platform/mac/compositing/geometry/vertical-scroll-composited-expected.png
index 3c6c406..054a1e7 100644
Binary files a/LayoutTests/platform/mac/compositing/geometry/vertical-scroll-composited-expected.png and b/LayoutTests/platform/mac/compositing/geometry/vertical-scroll-composited-expected.png differ
diff --git a/LayoutTests/platform/mac/compositing/geometry/vertical-scroll-composited-expected.txt b/LayoutTests/platform/mac/compositing/geometry/vertical-scroll-composited-expected.txt
index 72f65e1..999fcd0 100644
--- a/LayoutTests/platform/mac/compositing/geometry/vertical-scroll-composited-expected.txt
+++ b/LayoutTests/platform/mac/compositing/geometry/vertical-scroll-composited-expected.txt
@@ -1,4 +1,4 @@
-layer at (0,0) size 814x1014
+layer at (0,0) size 962x1122
   RenderView at (0,0) size 785x585
 layer at (0,0) size 785x616
   RenderBlock {HTML} at (0,0) size 785x616
diff --git a/LayoutTests/platform/mac/fast/backgrounds/repeat/negative-offset-repeat-transformed-expected.checksum b/LayoutTests/platform/mac/fast/backgrounds/repeat/negative-offset-repeat-transformed-expected.checksum
index 5318c47..9ffff17 100644
--- a/LayoutTests/platform/mac/fast/backgrounds/repeat/negative-offset-repeat-transformed-expected.checksum
+++ b/LayoutTests/platform/mac/fast/backgrounds/repeat/negative-offset-repeat-transformed-expected.checksum
@@ -1 +1 @@
-f67c62efac1943019610ce400cb5ed30
\ No newline at end of file
+8a91e2a38dba6652ec6a4c127ca4b266
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/backgrounds/repeat/negative-offset-repeat-transformed-expected.png b/LayoutTests/platform/mac/fast/backgrounds/repeat/negative-offset-repeat-transformed-expected.png
index e33496d..1916e0a 100644
Binary files a/LayoutTests/platform/mac/fast/backgrounds/repeat/negative-offset-repeat-transformed-expected.png and b/LayoutTests/platform/mac/fast/backgrounds/repeat/negative-offset-repeat-transformed-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/backgrounds/repeat/negative-offset-repeat-transformed-expected.txt b/LayoutTests/platform/mac/fast/backgrounds/repeat/negative-offset-repeat-transformed-expected.txt
index 728f87f..6310dce 100644
--- a/LayoutTests/platform/mac/fast/backgrounds/repeat/negative-offset-repeat-transformed-expected.txt
+++ b/LayoutTests/platform/mac/fast/backgrounds/repeat/negative-offset-repeat-transformed-expected.txt
@@ -1,5 +1,5 @@
-layer at (0,0) size 785x1020
-  RenderView at (0,0) size 785x600
+layer at (0,0) size 1122x1020
+  RenderView at (0,0) size 785x585
 layer at (0,0) size 785x1020
   RenderBlock {HTML} at (0,0) size 785x1020
     RenderBody {BODY} at (8,16) size 769x996
diff --git a/LayoutTests/platform/mac/fast/borders/border-image-rotate-transform-expected.checksum b/LayoutTests/platform/mac/fast/borders/border-image-rotate-transform-expected.checksum
index 3a6592e..947a146 100644
--- a/LayoutTests/platform/mac/fast/borders/border-image-rotate-transform-expected.checksum
+++ b/LayoutTests/platform/mac/fast/borders/border-image-rotate-transform-expected.checksum
@@ -1 +1 @@
-0cf932e7fd01d2f2d35a2173d17c6bc7
\ No newline at end of file
+5f1790bd3fcdc71480b77004f2d447db
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/borders/border-image-rotate-transform-expected.png b/LayoutTests/platform/mac/fast/borders/border-image-rotate-transform-expected.png
index 6f1d203..acaf7d1 100644
Binary files a/LayoutTests/platform/mac/fast/borders/border-image-rotate-transform-expected.png and b/LayoutTests/platform/mac/fast/borders/border-image-rotate-transform-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/borders/border-image-rotate-transform-expected.txt b/LayoutTests/platform/mac/fast/borders/border-image-rotate-transform-expected.txt
index 4934cef..2fb73e5 100644
--- a/LayoutTests/platform/mac/fast/borders/border-image-rotate-transform-expected.txt
+++ b/LayoutTests/platform/mac/fast/borders/border-image-rotate-transform-expected.txt
@@ -1,9 +1,9 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-layer at (8,8) size 784x584
-  RenderBody {BODY} at (8,8) size 784x584
+layer at (0,0) size 809x706
+  RenderView at (0,0) size 785x585
+layer at (0,0) size 785x585
+  RenderBlock {HTML} at (0,0) size 785x585
+layer at (8,8) size 769x569
+  RenderBody {BODY} at (8,8) size 769x569
     RenderBlock {DIV} at (10,10) size 126x126 [border: (21px none #000000) (30px none #000000) (21px none #000000)]
     RenderText {#text} at (146,132) size 4x18
       text run at (146,132) width 4: " "
diff --git a/LayoutTests/platform/mac/fast/borders/border-image-scale-transform-expected.checksum b/LayoutTests/platform/mac/fast/borders/border-image-scale-transform-expected.checksum
index 6553067..599b90a 100644
--- a/LayoutTests/platform/mac/fast/borders/border-image-scale-transform-expected.checksum
+++ b/LayoutTests/platform/mac/fast/borders/border-image-scale-transform-expected.checksum
@@ -1 +1 @@
-766dafbc273aefb67aef4839c5d3070a
\ No newline at end of file
+a9d9bcb43045368890d103015409e9e1
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/borders/border-image-scale-transform-expected.png b/LayoutTests/platform/mac/fast/borders/border-image-scale-transform-expected.png
index 50d7a52..a81d089 100644
Binary files a/LayoutTests/platform/mac/fast/borders/border-image-scale-transform-expected.png and b/LayoutTests/platform/mac/fast/borders/border-image-scale-transform-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/borders/border-image-scale-transform-expected.txt b/LayoutTests/platform/mac/fast/borders/border-image-scale-transform-expected.txt
index 4934cef..8ece465 100644
--- a/LayoutTests/platform/mac/fast/borders/border-image-scale-transform-expected.txt
+++ b/LayoutTests/platform/mac/fast/borders/border-image-scale-transform-expected.txt
@@ -1,9 +1,9 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-layer at (8,8) size 784x584
-  RenderBody {BODY} at (8,8) size 784x584
+layer at (0,0) size 1546x1146
+  RenderView at (0,0) size 785x585
+layer at (0,0) size 785x585
+  RenderBlock {HTML} at (0,0) size 785x585
+layer at (8,8) size 769x569
+  RenderBody {BODY} at (8,8) size 769x569
     RenderBlock {DIV} at (10,10) size 126x126 [border: (21px none #000000) (30px none #000000) (21px none #000000)]
     RenderText {#text} at (146,132) size 4x18
       text run at (146,132) width 4: " "
diff --git a/LayoutTests/platform/mac/fast/forms/search-transformed-expected.checksum b/LayoutTests/platform/mac/fast/forms/search-transformed-expected.checksum
index 2ac1d1a..42c748d 100644
--- a/LayoutTests/platform/mac/fast/forms/search-transformed-expected.checksum
+++ b/LayoutTests/platform/mac/fast/forms/search-transformed-expected.checksum
@@ -1 +1 @@
-8e6df3f865bb816151db58bcddb33be0
\ No newline at end of file
+bc943ed33bb2e7139fbc641b7aa88163
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/forms/search-transformed-expected.png b/LayoutTests/platform/mac/fast/forms/search-transformed-expected.png
index 924e662..0d3cc60 100644
Binary files a/LayoutTests/platform/mac/fast/forms/search-transformed-expected.png and b/LayoutTests/platform/mac/fast/forms/search-transformed-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/forms/search-transformed-expected.txt b/LayoutTests/platform/mac/fast/forms/search-transformed-expected.txt
index d529371..b62060a 100644
--- a/LayoutTests/platform/mac/fast/forms/search-transformed-expected.txt
+++ b/LayoutTests/platform/mac/fast/forms/search-transformed-expected.txt
@@ -1,8 +1,8 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x576
+layer at (0,0) size 842x585
+  RenderView at (0,0) size 800x585
+layer at (0,0) size 800x585
+  RenderBlock {HTML} at (0,0) size 800x585
+    RenderBody {BODY} at (8,8) size 784x561
       RenderBlock {P} at (0,0) size 784x36
         RenderText {#text} at (0,0) size 53x18
           text run at (0,0) width 53: "Test for "
diff --git a/LayoutTests/platform/mac/fast/transforms/rotated-transform-affects-scrolling-1-expected.checksum b/LayoutTests/platform/mac/fast/transforms/rotated-transform-affects-scrolling-1-expected.checksum
new file mode 100644
index 0000000..aecd1f1
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/transforms/rotated-transform-affects-scrolling-1-expected.checksum
@@ -0,0 +1 @@
+1b7f6c11387482f157102565052fabb0
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/transforms/rotated-transform-affects-scrolling-1-expected.png b/LayoutTests/platform/mac/fast/transforms/rotated-transform-affects-scrolling-1-expected.png
new file mode 100644
index 0000000..7eb8896
Binary files /dev/null and b/LayoutTests/platform/mac/fast/transforms/rotated-transform-affects-scrolling-1-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/transforms/rotated-transform-affects-scrolling-1-expected.txt b/LayoutTests/platform/mac/fast/transforms/rotated-transform-affects-scrolling-1-expected.txt
new file mode 100644
index 0000000..d9bbaf9
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/transforms/rotated-transform-affects-scrolling-1-expected.txt
@@ -0,0 +1,7 @@
+layer at (0,0) size 932x691
+  RenderView at (0,0) size 785x585
+layer at (0,0) size 785x585
+  RenderBlock {HTML} at (0,0) size 785x585
+    RenderBody {BODY} at (8,8) size 769x569
+layer at (8,8) size 1304x104 backgroundClip at (0,0) size 932x691 clip at (0,0) size 932x691 outlineClip at (0,0) size 932x691
+  RenderBlock {DIV} at (0,0) size 1304x104 [bgcolor=#800080] [border: (2px solid #0000FF) (2px solid #00FFFF) (2px solid #008000) (2px solid #FF0000)]
diff --git a/LayoutTests/platform/mac/fast/transforms/rotated-transform-affects-scrolling-2-expected.checksum b/LayoutTests/platform/mac/fast/transforms/rotated-transform-affects-scrolling-2-expected.checksum
new file mode 100644
index 0000000..fdf0f6f
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/transforms/rotated-transform-affects-scrolling-2-expected.checksum
@@ -0,0 +1 @@
+49c39b2b8f067d5d60c3615f6561d43a
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/transforms/rotated-transform-affects-scrolling-2-expected.png b/LayoutTests/platform/mac/fast/transforms/rotated-transform-affects-scrolling-2-expected.png
new file mode 100644
index 0000000..2660aa2
Binary files /dev/null and b/LayoutTests/platform/mac/fast/transforms/rotated-transform-affects-scrolling-2-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/transforms/rotated-transform-affects-scrolling-2-expected.txt b/LayoutTests/platform/mac/fast/transforms/rotated-transform-affects-scrolling-2-expected.txt
new file mode 100644
index 0000000..815c2ea
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/transforms/rotated-transform-affects-scrolling-2-expected.txt
@@ -0,0 +1,7 @@
+layer at (0,0) size 825x712
+  RenderView at (0,0) size 785x585
+layer at (0,0) size 785x585
+  RenderBlock {HTML} at (0,0) size 785x585
+    RenderBody {BODY} at (8,8) size 769x569
+layer at (8,8) size 1304x104 backgroundClip at (0,0) size 825x712 clip at (0,0) size 825x712 outlineClip at (0,0) size 825x712
+  RenderBlock {DIV} at (0,0) size 1304x104 [bgcolor=#800080] [border: (2px solid #0000FF) (2px solid #00FFFF) (2px solid #008000) (2px solid #FF0000)]
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 0e5c32b..a1b1b6a 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,47 @@
+2010-10-20  Beth Dakin  <bdakin at apple.com>
+
+        Reviewed by Dave Hyatt.
+
+        Fix for https://bugs.webkit.org/show_bug.cgi?id=47514 CSS 
+        transforms should affect scrolling
+
+        This patch causes topmostPosition, lowestPosition, 
+        leftmostPosition, and rightmostPosition to take transforms into 
+        account.
+
+        Compute the topmost/lowest/leftmost/rightmost position without 
+        factoring in the block's transform until the end.
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::topmostPosition):
+        (WebCore::RenderBlock::lowestPosition):
+        (WebCore::RenderBlock::rightmostPosition):
+        (WebCore::RenderBlock::leftmostPosition):
+        * rendering/RenderBlock.h:
+
+        transformedFrameRect() returns the frameRect() transformed to the 
+        layer's transform. applyLayerTransformToRect() does the same thing 
+        for the input rect.
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::applyLayerTransformToRect):
+        (WebCore::RenderBox::transformedFrameRect):
+        (WebCore::RenderBox::topmostPosition):
+        (WebCore::RenderBox::lowestPosition):
+        (WebCore::RenderBox::rightmostPosition):
+        (WebCore::RenderBox::leftmostPosition):
+        * rendering/RenderBox.h:
+        * rendering/RenderMedia.cpp:
+        (WebCore::RenderMedia::topmostPosition):
+        (WebCore::RenderMedia::lowestPosition):
+        (WebCore::RenderMedia::rightmostPosition):
+        (WebCore::RenderMedia::leftmostPosition):
+        * rendering/RenderMedia.h:
+        * rendering/RenderTableSection.cpp:
+        (WebCore::RenderTableSection::topmostPosition):
+        (WebCore::RenderTableSection::lowestPosition):
+        (WebCore::RenderTableSection::rightmostPosition):
+        (WebCore::RenderTableSection::leftmostPosition):
+        * rendering/RenderTableSection.h:
+
 2010-10-20  Nikolas Zimmermann  <nzimmermann at rim.com>
 
         Not reviewed.
diff --git a/WebCore/rendering/RenderBlock.cpp b/WebCore/rendering/RenderBlock.cpp
index 41347e2..771c6d7 100644
--- a/WebCore/rendering/RenderBlock.cpp
+++ b/WebCore/rendering/RenderBlock.cpp
@@ -3336,15 +3336,18 @@ int RenderBlock::lowestFloatLogicalBottom(FloatingObject::Type floatType) const
     return lowestFloatBottom;
 }
 
-int RenderBlock::topmostPosition(bool includeOverflowInterior, bool includeSelf) const
+int RenderBlock::topmostPosition(bool includeOverflowInterior, bool includeSelf, ApplyTransform applyTransform) const
 {
-    int top = includeSelf && width() > 0 ? 0 : height();
+    IntRect transformedRect = transformedFrameRect();
+    int transformedTop = includeSelf && transformedRect.width() > 0 ? 0 : transformedRect.height();
     
     if (!includeOverflowInterior && (hasOverflowClip() || hasControlClip()))
-        return top;
+        return transformedTop;
 
-    if (!firstChild() && (!width() || !height()))
-        return top;
+    if (!firstChild() && (!transformedRect.width() || !transformedRect.height()))
+        return transformedTop;
+
+    int top = includeSelf && width() > 0 ? 0 : height();
 
     if (!hasColumns()) {
         // FIXME: Come up with a way to use the layer tree to avoid visiting all the kids.
@@ -3354,7 +3357,7 @@ int RenderBlock::topmostPosition(bool includeOverflowInterior, bool includeSelf)
         for (RenderObject* c = firstChild(); c; c = c->nextSibling()) {
             if (!c->isFloatingOrPositioned() && c->isBox()) {
                 RenderBox* childBox = toRenderBox(c);
-                top = min(top, childBox->y() + childBox->topmostPosition(false));
+                top = min(top, childBox->transformedFrameRect().y() + childBox->topmostPosition(false));
             }
         }
     }
@@ -3381,8 +3384,9 @@ int RenderBlock::topmostPosition(bool includeOverflowInterior, bool includeSelf)
                 // FIXME: Should work for overflow sections too.
                 // If a positioned object lies completely to the left of the root it will be unreachable via scrolling.
                 // Therefore we should not allow it to contribute to the topmost position.
-                if (!isRenderView() || r->x() + r->width() > 0 || r->x() + r->rightmostPosition(false) > 0) {
-                    int tp = r->y() + r->topmostPosition(false);
+                IntRect transformedR = r->transformedFrameRect();
+                if (!isRenderView() || transformedR.x() + transformedR.width() > 0 || transformedR.x() + r->rightmostPosition(false) > 0) {
+                    int tp = transformedR.y() + r->topmostPosition(false);
                     top = min(top, tp + relativeOffset);
                 }
             }
@@ -3409,20 +3413,31 @@ int RenderBlock::topmostPosition(bool includeOverflowInterior, bool includeSelf)
 
     if (!includeSelf && firstRootBox())
         top = min(top, firstRootBox()->selectionTop() + relativeOffset);
-    
+
+    if (applyTransform == IncludeTransform && includeSelf && layer() && layer()->hasTransform()) {
+        int bottom = lowestPosition(includeOverflowInterior, includeSelf, ExcludeTransform);
+        int right = rightmostPosition(includeOverflowInterior, includeSelf, ExcludeTransform);
+        int left = leftmostPosition(includeOverflowInterior, includeSelf, ExcludeTransform);
+        IntRect transformRect = applyLayerTransformToRect(IntRect(left, top, right - left, bottom - top));
+        return transformRect.y();
+    }
+
     return top;
 }
 
-int RenderBlock::lowestPosition(bool includeOverflowInterior, bool includeSelf) const
+int RenderBlock::lowestPosition(bool includeOverflowInterior, bool includeSelf, ApplyTransform applyTransform) const
 {
-    int bottom = includeSelf && width() > 0 ? height() : 0;
+    IntRect transformedRect = transformedFrameRect();
+    int transformedBottom = includeSelf && transformedRect.width() > 0 ? transformedRect.height() : 0;
 
     if (!includeOverflowInterior && (hasOverflowClip() || hasControlClip()))
-        return bottom;
+        return transformedBottom;
+
+    if (!firstChild() && (!transformedRect.width() || !transformedRect.height()))
+        return transformedBottom;
+
+    int bottom = includeSelf && width() > 0 ? height() : 0;
 
-    if (!firstChild() && (!width() || !height()))
-        return bottom;
-    
     if (!hasColumns()) {
         // FIXME: Come up with a way to use the layer tree to avoid visiting all the kids.
         // For now, we have to descend into all the children, since we may have a huge abs div inside
@@ -3433,7 +3448,7 @@ int RenderBlock::lowestPosition(bool includeOverflowInterior, bool includeSelf)
         for (RenderObject* c = firstChild(); c; c = c->nextSibling()) {
             if (!c->isFloatingOrPositioned() && c->isBox()) {
                 RenderBox* childBox = toRenderBox(c);
-                bottom = max(bottom, childBox->y() + childBox->lowestPosition(false));
+                bottom = max(bottom, childBox->transformedFrameRect().y() + childBox->lowestPosition(false));
             }
         }
     }
@@ -3459,8 +3474,9 @@ int RenderBlock::lowestPosition(bool includeOverflowInterior, bool includeSelf)
                 // FIXME: Should work for overflow sections too.
                 // If a positioned object lies completely to the left of the root it will be unreachable via scrolling.
                 // Therefore we should not allow it to contribute to the lowest position.
-                if (!isRenderView() || r->x() + r->width() > 0 || r->x() + r->rightmostPosition(false) > 0) {
-                    int lp = r->y() + r->lowestPosition(false);
+                IntRect transformedR = r->transformedFrameRect();
+                if (!isRenderView() || transformedR.x() + transformedR.width() > 0 || transformedR.x() + r->rightmostPosition(false) > 0) {
+                    int lp = transformedR.y() + r->lowestPosition(false);
                     bottom = max(bottom, lp + relativeOffset);
                 }
             }
@@ -3498,24 +3514,36 @@ int RenderBlock::lowestPosition(bool includeOverflowInterior, bool includeSelf)
             while (currBox && currBox->isFloatingOrPositioned())
                 currBox = currBox->previousSiblingBox();
             if (currBox) {
-                int childBottomEdge = currBox->y() + currBox->height() + currBox->collapsedMarginAfter(); // FIXME: "after" is wrong here for lowestPosition.
+                IntRect transformedCurrBox = currBox->transformedFrameRect();
+                int childBottomEdge = transformedCurrBox.y() + transformedCurrBox.height() + currBox->collapsedMarginAfter(); // FIXME: "after" is wrong here for lowestPosition.
                 bottom = max(bottom, childBottomEdge + paddingBottom() + relativeOffset);
             }
         }
     }
-    
+
+    if (applyTransform == IncludeTransform && includeSelf && layer() && layer()->hasTransform()) {
+        int top = topmostPosition(includeOverflowInterior, includeSelf, ExcludeTransform);
+        int right = rightmostPosition(includeOverflowInterior, includeSelf, ExcludeTransform);
+        int left = leftmostPosition(includeOverflowInterior, includeSelf, ExcludeTransform);
+        IntRect transformRect = applyLayerTransformToRect(IntRect(left, top, right - left, bottom - top));
+        return transformRect.height();
+    }
+
     return bottom;
 }
 
-int RenderBlock::rightmostPosition(bool includeOverflowInterior, bool includeSelf) const
+int RenderBlock::rightmostPosition(bool includeOverflowInterior, bool includeSelf, ApplyTransform applyTransform) const
 {
-    int right = includeSelf && height() > 0 ? width() : 0;
+    IntRect transformedRect = transformedFrameRect();
+    int transformedRight = includeSelf && transformedRect.height() > 0 ? transformedRect.width() : 0;
 
     if (!includeOverflowInterior && (hasOverflowClip() || hasControlClip()))
-        return right;
+        return transformedRight;
 
-    if (!firstChild() && (!width() || !height()))
-        return right;
+    if (!firstChild() && (!transformedRect.width() || !transformedRect.height()))
+        return transformedRight;
+
+    int right = includeSelf && height() > 0 ? width() : 0;
 
     if (!hasColumns()) {
         // FIXME: Come up with a way to use the layer tree to avoid visiting all the kids.
@@ -3525,7 +3553,7 @@ int RenderBlock::rightmostPosition(bool includeOverflowInterior, bool includeSel
         for (RenderObject* c = firstChild(); c; c = c->nextSibling()) {
             if (!c->isFloatingOrPositioned() && c->isBox()) {
                 RenderBox* childBox = toRenderBox(c);
-                right = max(right, childBox->x() + childBox->rightmostPosition(false));
+                right = max(right, childBox->transformedFrameRect().x() + childBox->rightmostPosition(false));
             }
         }
     }
@@ -3552,8 +3580,9 @@ int RenderBlock::rightmostPosition(bool includeOverflowInterior, bool includeSel
                 // FIXME: Should work for overflow sections too.
                 // If a positioned object lies completely above the root it will be unreachable via scrolling.
                 // Therefore we should not allow it to contribute to the rightmost position.
-                if (!isRenderView() || r->y() + r->height() > 0 || r->y() + r->lowestPosition(false) > 0) {
-                    int rp = r->x() + r->rightmostPosition(false);
+                IntRect transformedR = r->transformedFrameRect();
+                if (!isRenderView() || transformedR.y() + transformedR.height() > 0 || transformedR.y() + r->lowestPosition(false) > 0) {
+                    int rp = transformedR.x() + r->rightmostPosition(false);
                     right = max(right, rp + relativeOffset);
                 }
             }
@@ -3568,6 +3597,13 @@ int RenderBlock::rightmostPosition(bool includeOverflowInterior, bool includeSel
             if (count)
                 right = max(columnRectAt(colInfo, count - 1).right() + relativeOffset, right);
         }
+        if (applyTransform == IncludeTransform && includeSelf && layer() && layer()->hasTransform()) {
+            int top = topmostPosition(includeOverflowInterior, includeSelf, ExcludeTransform);
+            int bottom = lowestPosition(includeOverflowInterior, includeSelf, ExcludeTransform);
+            int left = leftmostPosition(includeOverflowInterior, includeSelf, ExcludeTransform);
+            IntRect transformRect = applyLayerTransformToRect(IntRect(left, top, right - left, bottom - top));
+            return transformRect.width();
+        }
         return right;
     }
 
@@ -3599,24 +3635,36 @@ int RenderBlock::rightmostPosition(bool includeOverflowInterior, bool includeSel
             for (RenderBox* currBox = firstChildBox(); currBox; currBox = currBox->nextSiblingBox()) {
                 if (currBox->isFloatingOrPositioned())
                     continue;
-                int childRightEdge = currBox->x() + currBox->width() + currBox->marginRight();
+                IntRect transformedChild = currBox->transformedFrameRect();
+                int childRightEdge = transformedChild.x() + transformedChild.width() + currBox->marginRight();
                 right = max(right, childRightEdge + paddingRight() + relativeOffset);
             }
         }
     }
+
+    if (applyTransform == IncludeTransform && includeSelf && layer() && layer()->hasTransform()) {
+        int top = topmostPosition(includeOverflowInterior, includeSelf, ExcludeTransform);
+        int bottom = lowestPosition(includeOverflowInterior, includeSelf, ExcludeTransform);
+        int left = leftmostPosition(includeOverflowInterior, includeSelf, ExcludeTransform);
+        IntRect transformRect = applyLayerTransformToRect(IntRect(left, top, right - left, bottom - top));
+        return transformRect.width();
+    }
     
     return right;
 }
 
-int RenderBlock::leftmostPosition(bool includeOverflowInterior, bool includeSelf) const
+int RenderBlock::leftmostPosition(bool includeOverflowInterior, bool includeSelf, ApplyTransform applyTransform) const
 {
-    int left = includeSelf && height() > 0 ? 0 : width();
+    IntRect transformedRect = transformedFrameRect();
+    int transformedLeft = includeSelf && transformedRect.height() > 0 ? 0 : transformedRect.width();
     
     if (!includeOverflowInterior && (hasOverflowClip() || hasControlClip()))
-        return left;
+        return transformedLeft;
 
-    if (!firstChild() && (!width() || !height()))
-        return left;
+    if (!firstChild() && (!transformedRect.width() || !transformedRect.height()))
+        return transformedLeft;
+
+    int left = includeSelf && height() > 0 ? 0 : width();
 
     if (!hasColumns()) {
         // FIXME: Come up with a way to use the layer tree to avoid visiting all the kids.
@@ -3626,7 +3674,7 @@ int RenderBlock::leftmostPosition(bool includeOverflowInterior, bool includeSelf
         for (RenderObject* c = firstChild(); c; c = c->nextSibling()) {
             if (!c->isFloatingOrPositioned() && c->isBox()) {
                 RenderBox* childBox = toRenderBox(c);
-                left = min(left, childBox->x() + childBox->leftmostPosition(false));
+                left = min(left, childBox->transformedFrameRect().x() + childBox->leftmostPosition(false));
             }
         }
     }
@@ -3653,8 +3701,9 @@ int RenderBlock::leftmostPosition(bool includeOverflowInterior, bool includeSelf
                 // FIXME: Should work for overflow sections too.
                 // If a positioned object lies completely above the root it will be unreachable via scrolling.
                 // Therefore we should not allow it to contribute to the leftmost position.
-                if (!isRenderView() || r->y() + r->height() > 0 || r->y() + r->lowestPosition(false) > 0) {
-                    int lp = r->x() + r->leftmostPosition(false);
+                IntRect transformedR = r->transformedFrameRect();
+                if (!isRenderView() || transformedR.y() + transformedR.height() > 0 || transformedR.y() + r->lowestPosition(false) > 0) {
+                    int lp = transformedR.x() + r->leftmostPosition(false);
                     left = min(left, lp + relativeOffset);
                 }
             }
@@ -3687,6 +3736,14 @@ int RenderBlock::leftmostPosition(bool includeOverflowInterior, bool includeSelf
         for (InlineFlowBox* currBox = firstLineBox(); currBox; currBox = currBox->nextLineBox())
             left = min(left, (int)currBox->x() + relativeOffset);
     }
+
+    if (applyTransform == IncludeTransform && includeSelf && layer() && layer()->hasTransform()) {
+        int top = topmostPosition(includeOverflowInterior, includeSelf, ExcludeTransform);
+        int bottom = lowestPosition(includeOverflowInterior, includeSelf, ExcludeTransform);
+        int right = rightmostPosition(includeOverflowInterior, includeSelf, ExcludeTransform);
+        IntRect transformRect = applyLayerTransformToRect(IntRect(left, top, right - left, bottom - top));
+        return transformRect.x();
+    }
     
     return left;
 }
diff --git a/WebCore/rendering/RenderBlock.h b/WebCore/rendering/RenderBlock.h
index c467289..66c8659 100644
--- a/WebCore/rendering/RenderBlock.h
+++ b/WebCore/rendering/RenderBlock.h
@@ -99,10 +99,10 @@ public:
     int logicalRightOffsetForLine(int position, bool firstLine) const { return logicalRightOffsetForLine(position, logicalRightOffsetForContent(), firstLine); }
     int logicalLeftOffsetForLine(int position, bool firstLine) const { return logicalLeftOffsetForLine(position, logicalLeftOffsetForContent(), firstLine); }
 
-    virtual int topmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
-    virtual int lowestPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
-    virtual int rightmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
-    virtual int leftmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
+    virtual int topmostPosition(bool includeOverflowInterior = true, bool includeSelf = true, ApplyTransform = IncludeTransform) const;
+    virtual int lowestPosition(bool includeOverflowInterior = true, bool includeSelf = true, ApplyTransform = IncludeTransform) const;
+    virtual int rightmostPosition(bool includeOverflowInterior = true, bool includeSelf = true, ApplyTransform = IncludeTransform) const;
+    virtual int leftmostPosition(bool includeOverflowInterior = true, bool includeSelf = true, ApplyTransform = IncludeTransform) const;
     
     virtual VisiblePosition positionForPoint(const IntPoint&);
     
diff --git a/WebCore/rendering/RenderBox.cpp b/WebCore/rendering/RenderBox.cpp
index a5ba19a..22f81d4 100644
--- a/WebCore/rendering/RenderBox.cpp
+++ b/WebCore/rendering/RenderBox.cpp
@@ -442,6 +442,24 @@ void RenderBox::absoluteQuads(Vector<FloatQuad>& quads)
     quads.append(localToAbsoluteQuad(FloatRect(0, 0, width(), height())));
 }
 
+IntRect RenderBox::applyLayerTransformToRect(const IntRect& rect) const
+{
+    if (layer() && layer()->hasTransform()) {
+        TransformationMatrix transform;
+        transform.makeIdentity();
+        transform.translate(rect.x(), rect.y());
+        layer()->updateTransform();
+        transform.multLeft(layer()->currentTransform());
+        return transform.mapRect(IntRect(0, 0, rect.width(), rect.height()));
+    }
+    return rect;
+}
+
+IntRect RenderBox::transformedFrameRect() const
+{
+    return applyLayerTransformToRect(frameRect());
+}
+
 IntRect RenderBox::absoluteContentBox() const
 {
     IntRect rect = contentBoxRect();
@@ -2914,9 +2932,10 @@ IntRect RenderBox::localCaretRect(InlineBox* box, int caretOffset, int* extraWid
     return rect;
 }
 
-int RenderBox::topmostPosition(bool /*includeOverflowInterior*/, bool includeSelf) const
+int RenderBox::topmostPosition(bool /*includeOverflowInterior*/, bool includeSelf, ApplyTransform applyTransform) const
 {
-    if (!includeSelf || !width())
+    IntRect transformedRect = applyTransform == IncludeTransform && includeSelf ? transformedFrameRect() : frameRect();
+    if (!includeSelf || !transformedRect.width())
         return 0;
     int top = 0;
     if (isRelPositioned())
@@ -2924,30 +2943,33 @@ int RenderBox::topmostPosition(bool /*includeOverflowInterior*/, bool includeSel
     return top;
 }
 
-int RenderBox::lowestPosition(bool /*includeOverflowInterior*/, bool includeSelf) const
+int RenderBox::lowestPosition(bool /*includeOverflowInterior*/, bool includeSelf, ApplyTransform applyTransform) const
 {
-    if (!includeSelf || !width())
+    IntRect transformedRect = applyTransform == IncludeTransform && includeSelf ? transformedFrameRect() : frameRect();
+    if (!includeSelf || !transformedRect.width())
         return 0;
-    int bottom = height();
+    int bottom = transformedRect.height();
     if (isRelPositioned())
         bottom += relativePositionOffsetY();
     return bottom;
 }
 
-int RenderBox::rightmostPosition(bool /*includeOverflowInterior*/, bool includeSelf) const
+int RenderBox::rightmostPosition(bool /*includeOverflowInterior*/, bool includeSelf, ApplyTransform applyTransform) const
 {
-    if (!includeSelf || !height())
+    IntRect transformedRect = applyTransform == IncludeTransform && includeSelf ? transformedFrameRect() : frameRect();
+    if (!includeSelf || !transformedRect.height())
         return 0;
-    int right = width();
+    int right = transformedRect.width();
     if (isRelPositioned())
         right += relativePositionOffsetX();
     return right;
 }
 
-int RenderBox::leftmostPosition(bool /*includeOverflowInterior*/, bool includeSelf) const
+int RenderBox::leftmostPosition(bool /*includeOverflowInterior*/, bool includeSelf, ApplyTransform applyTransform) const
 {
-    if (!includeSelf || !height())
-        return width();
+    IntRect transformedRect = applyTransform == IncludeTransform && includeSelf ? transformedFrameRect() : frameRect();
+    if (!includeSelf || !transformedRect.height())
+        return transformedRect.width();
     int left = 0;
     if (isRelPositioned())
         left += relativePositionOffsetX();
diff --git a/WebCore/rendering/RenderBox.h b/WebCore/rendering/RenderBox.h
index 30a96c0..7ee6b72 100644
--- a/WebCore/rendering/RenderBox.h
+++ b/WebCore/rendering/RenderBox.h
@@ -103,6 +103,9 @@ public:
     IntRect frameRect() const { return m_frameRect; }
     void setFrameRect(const IntRect& rect) { m_frameRect = rect; }
 
+    IntRect transformedFrameRect() const;
+    IntRect applyLayerTransformToRect(const IntRect&) const;
+
     IntRect borderBoxRect() const { return IntRect(0, 0, width(), height()); }
     virtual IntRect borderBoundingBox() const { return borderBoxRect(); } 
     
@@ -259,10 +262,11 @@ public:
     void setInlineBoxWrapper(InlineBox* boxWrapper) { m_inlineBoxWrapper = boxWrapper; }
     void deleteLineBoxWrapper();
 
-    virtual int topmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
-    virtual int lowestPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
-    virtual int rightmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
-    virtual int leftmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
+    enum ApplyTransform { IncludeTransform, ExcludeTransform };
+    virtual int topmostPosition(bool includeOverflowInterior = true, bool includeSelf = true, ApplyTransform = IncludeTransform) const;
+    virtual int lowestPosition(bool includeOverflowInterior = true, bool includeSelf = true,  ApplyTransform = IncludeTransform) const;
+    virtual int rightmostPosition(bool includeOverflowInterior = true, bool includeSelf = true, ApplyTransform = IncludeTransform) const;
+    virtual int leftmostPosition(bool includeOverflowInterior = true, bool includeSelf = true, ApplyTransform = IncludeTransform) const;
 
     virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer);
     virtual void computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect&, bool fixed = false);
diff --git a/WebCore/rendering/RenderMedia.cpp b/WebCore/rendering/RenderMedia.cpp
index e26ee26..49a536c 100644
--- a/WebCore/rendering/RenderMedia.cpp
+++ b/WebCore/rendering/RenderMedia.cpp
@@ -34,6 +34,7 @@
 #include "MediaControlElements.h"
 #include "MouseEvent.h"
 #include "Page.h"
+#include "RenderLayer.h"
 #include "RenderTheme.h"
 #include <wtf/CurrentTime.h>
 #include <wtf/MathExtras.h>
@@ -599,40 +600,80 @@ void RenderMedia::forwardEvent(Event* event)
     }
 }
 
-int RenderMedia::topmostPosition(bool includeOverflowInterior, bool includeSelf) const
+int RenderMedia::topmostPosition(bool includeOverflowInterior, bool includeSelf, ApplyTransform applyTransform) const
 {
-    int top = RenderImage::topmostPosition(includeOverflowInterior, includeSelf);
+    int top = RenderImage::topmostPosition(includeOverflowInterior, includeSelf, applyTransform);
     if (!m_controlsShadowRoot || !m_controlsShadowRoot->renderer())
         return top;
     
-    return min(top,  m_controlsShadowRoot->renderBox()->y() + m_controlsShadowRoot->renderBox()->topmostPosition(includeOverflowInterior, includeSelf));
+    top = min(top,  m_controlsShadowRoot->renderBox()->transformedFrameRect().y() + m_controlsShadowRoot->renderBox()->topmostPosition(includeOverflowInterior, includeSelf, applyTransform));
+
+    if (applyTransform == IncludeTransform && includeSelf && layer() && layer()->hasTransform()) {
+        int bottom = lowestPosition(includeOverflowInterior, includeSelf, ExcludeTransform);
+        int right = rightmostPosition(includeOverflowInterior, includeSelf, ExcludeTransform);
+        int left = leftmostPosition(includeOverflowInterior, includeSelf, ExcludeTransform);
+        IntRect transformRect = applyLayerTransformToRect(IntRect(left, top, right - left, bottom - top));
+        return transformRect.y();
+    }
+
+    return top;
 }
 
-int RenderMedia::lowestPosition(bool includeOverflowInterior, bool includeSelf) const
+int RenderMedia::lowestPosition(bool includeOverflowInterior, bool includeSelf, ApplyTransform applyTransform) const
 {
-    int bottom = RenderImage::lowestPosition(includeOverflowInterior, includeSelf);
+    int bottom = RenderImage::lowestPosition(includeOverflowInterior, includeSelf, applyTransform);
     if (!m_controlsShadowRoot || !m_controlsShadowRoot->renderer())
         return bottom;
     
-    return max(bottom,  m_controlsShadowRoot->renderBox()->y() + m_controlsShadowRoot->renderBox()->lowestPosition(includeOverflowInterior, includeSelf));
+    bottom = max(bottom,  m_controlsShadowRoot->renderBox()->transformedFrameRect().y() + m_controlsShadowRoot->renderBox()->lowestPosition(includeOverflowInterior, includeSelf, applyTransform));
+
+    if (applyTransform == IncludeTransform && includeSelf && layer() && layer()->hasTransform()) {
+        int top = topmostPosition(includeOverflowInterior, includeSelf, ExcludeTransform);
+        int right = rightmostPosition(includeOverflowInterior, includeSelf, ExcludeTransform);
+        int left = leftmostPosition(includeOverflowInterior, includeSelf, ExcludeTransform);
+        IntRect transformRect = applyLayerTransformToRect(IntRect(left, top, right - left, bottom - top));
+        return transformRect.height() + transformRect.y();
+    }
+
+    return bottom;
 }
 
-int RenderMedia::rightmostPosition(bool includeOverflowInterior, bool includeSelf) const
+int RenderMedia::rightmostPosition(bool includeOverflowInterior, bool includeSelf, ApplyTransform applyTransform) const
 {
-    int right = RenderImage::rightmostPosition(includeOverflowInterior, includeSelf);
+    int right = RenderImage::rightmostPosition(includeOverflowInterior, includeSelf, applyTransform);
     if (!m_controlsShadowRoot || !m_controlsShadowRoot->renderer())
         return right;
     
-    return max(right, m_controlsShadowRoot->renderBox()->x() + m_controlsShadowRoot->renderBox()->rightmostPosition(includeOverflowInterior, includeSelf));
+    right = max(right, m_controlsShadowRoot->renderBox()->transformedFrameRect().x() + m_controlsShadowRoot->renderBox()->rightmostPosition(includeOverflowInterior, includeSelf, applyTransform));
+
+    if (applyTransform == IncludeTransform && includeSelf && layer() && layer()->hasTransform()) {
+        int top = rightmostPosition(includeOverflowInterior, includeSelf, ExcludeTransform);
+        int bottom = lowestPosition(includeOverflowInterior, includeSelf, ExcludeTransform);
+        int left = leftmostPosition(includeOverflowInterior, includeSelf, ExcludeTransform);
+        IntRect transformRect = applyLayerTransformToRect(IntRect(left, top, right - left, bottom - top));
+        return transformRect.width() + transformRect.x();
+    }
+
+    return right;
 }
 
-int RenderMedia::leftmostPosition(bool includeOverflowInterior, bool includeSelf) const
+int RenderMedia::leftmostPosition(bool includeOverflowInterior, bool includeSelf, ApplyTransform applyTransform) const
 {
-    int left = RenderImage::leftmostPosition(includeOverflowInterior, includeSelf);
+    int left = RenderImage::leftmostPosition(includeOverflowInterior, includeSelf, applyTransform);
     if (!m_controlsShadowRoot || !m_controlsShadowRoot->renderer())
         return left;
     
-    return min(left, m_controlsShadowRoot->renderBox()->x() +  m_controlsShadowRoot->renderBox()->leftmostPosition(includeOverflowInterior, includeSelf));
+    left = min(left, m_controlsShadowRoot->renderBox()->transformedFrameRect().x() +  m_controlsShadowRoot->renderBox()->leftmostPosition(includeOverflowInterior, includeSelf, applyTransform));
+
+    if (applyTransform == IncludeTransform && includeSelf && layer() && layer()->hasTransform()) {
+        int top = rightmostPosition(includeOverflowInterior, includeSelf, ExcludeTransform);
+        int bottom = lowestPosition(includeOverflowInterior, includeSelf, ExcludeTransform);
+        int right = rightmostPosition(includeOverflowInterior, includeSelf, ExcludeTransform);
+        IntRect transformRect = applyLayerTransformToRect(IntRect(left, top, right - left, bottom - top));
+        return transformRect.x();
+    }
+
+    return left;
 }
 
 
diff --git a/WebCore/rendering/RenderMedia.h b/WebCore/rendering/RenderMedia.h
index 2bdbbd1..aa725ff 100644
--- a/WebCore/rendering/RenderMedia.h
+++ b/WebCore/rendering/RenderMedia.h
@@ -85,10 +85,10 @@ private:
     virtual bool isMedia() const { return true; }
     virtual bool isImage() const { return false; }
 
-    virtual int topmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
-    virtual int lowestPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
-    virtual int rightmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
-    virtual int leftmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
+    virtual int topmostPosition(bool includeOverflowInterior = true, bool includeSelf = true, ApplyTransform = IncludeTransform) const;
+    virtual int lowestPosition(bool includeOverflowInterior = true, bool includeSelf = true, ApplyTransform = IncludeTransform) const;
+    virtual int rightmostPosition(bool includeOverflowInterior = true, bool includeSelf = true, ApplyTransform = IncludeTransform) const;
+    virtual int leftmostPosition(bool includeOverflowInterior = true, bool includeSelf = true, ApplyTransform = IncludeTransform) const;
 
     void createControlsShadowRoot();
     void destroyControlsShadowRoot();
diff --git a/WebCore/rendering/RenderTableSection.cpp b/WebCore/rendering/RenderTableSection.cpp
index b74daef..837cc03 100644
--- a/WebCore/rendering/RenderTableSection.cpp
+++ b/WebCore/rendering/RenderTableSection.cpp
@@ -661,9 +661,9 @@ int RenderTableSection::layoutRows(int toAdd)
     return height();
 }
 
-int RenderTableSection::topmostPosition(bool includeOverflowInterior, bool includeSelf) const
+int RenderTableSection::topmostPosition(bool includeOverflowInterior, bool includeSelf, ApplyTransform applyTransform) const
 {
-    int top = RenderBox::topmostPosition(includeOverflowInterior, includeSelf);
+    int top = RenderBox::topmostPosition(includeOverflowInterior, includeSelf, applyTransform);
     if (!includeOverflowInterior && hasOverflowClip())
         return top;
 
@@ -671,7 +671,7 @@ int RenderTableSection::topmostPosition(bool includeOverflowInterior, bool inclu
         for (RenderObject* curr = row->firstChild(); curr; curr = curr->nextSibling()) {
             if (curr->isTableCell()) {
                 RenderTableCell* cell = toRenderTableCell(curr);
-                top = min(top, cell->y() + cell->topmostPosition(false));
+                top = min(top, cell->transformedFrameRect().y() + cell->topmostPosition(false));
             }
         }
     }
@@ -679,9 +679,9 @@ int RenderTableSection::topmostPosition(bool includeOverflowInterior, bool inclu
     return top;
 }
 
-int RenderTableSection::lowestPosition(bool includeOverflowInterior, bool includeSelf) const
+int RenderTableSection::lowestPosition(bool includeOverflowInterior, bool includeSelf, ApplyTransform applyTransform) const
 {
-    int bottom = RenderBox::lowestPosition(includeOverflowInterior, includeSelf);
+    int bottom = RenderBox::lowestPosition(includeOverflowInterior, includeSelf, applyTransform);
     if (!includeOverflowInterior && hasOverflowClip())
         return bottom;
 
@@ -689,7 +689,7 @@ int RenderTableSection::lowestPosition(bool includeOverflowInterior, bool includ
         for (RenderObject* curr = row->firstChild(); curr; curr = curr->nextSibling()) {
             if (curr->isTableCell()) {
                 RenderTableCell* cell = toRenderTableCell(curr);
-                bottom = max(bottom, cell->y() + cell->lowestPosition(false));
+                bottom = max(bottom, cell->transformedFrameRect().y() + cell->lowestPosition(false));
             }
         }
     }
@@ -697,9 +697,9 @@ int RenderTableSection::lowestPosition(bool includeOverflowInterior, bool includ
     return bottom;
 }
 
-int RenderTableSection::rightmostPosition(bool includeOverflowInterior, bool includeSelf) const
+int RenderTableSection::rightmostPosition(bool includeOverflowInterior, bool includeSelf, ApplyTransform applyTransform) const
 {
-    int right = RenderBox::rightmostPosition(includeOverflowInterior, includeSelf);
+    int right = RenderBox::rightmostPosition(includeOverflowInterior, includeSelf, applyTransform);
     if (!includeOverflowInterior && hasOverflowClip())
         return right;
 
@@ -707,7 +707,7 @@ int RenderTableSection::rightmostPosition(bool includeOverflowInterior, bool inc
         for (RenderObject* curr = row->firstChild(); curr; curr = curr->nextSibling()) {
             if (curr->isTableCell()) {
                 RenderTableCell* cell = toRenderTableCell(curr);
-                right = max(right, cell->x() + cell->rightmostPosition(false));
+                right = max(right, cell->transformedFrameRect().x() + cell->rightmostPosition(false));
             }
         }
     }
@@ -715,9 +715,9 @@ int RenderTableSection::rightmostPosition(bool includeOverflowInterior, bool inc
     return right;
 }
 
-int RenderTableSection::leftmostPosition(bool includeOverflowInterior, bool includeSelf) const
+int RenderTableSection::leftmostPosition(bool includeOverflowInterior, bool includeSelf, ApplyTransform applyTransform) const
 {
-    int left = RenderBox::leftmostPosition(includeOverflowInterior, includeSelf);
+    int left = RenderBox::leftmostPosition(includeOverflowInterior, includeSelf, applyTransform);
     if (!includeOverflowInterior && hasOverflowClip())
         return left;
     
@@ -725,7 +725,7 @@ int RenderTableSection::leftmostPosition(bool includeOverflowInterior, bool incl
         for (RenderObject* curr = row->firstChild(); curr; curr = curr->nextSibling()) {
             if (curr->isTableCell()) {
                 RenderTableCell* cell = toRenderTableCell(curr);
-                left = min(left, cell->x() + cell->leftmostPosition(false));
+                left = min(left, cell->transformedFrameRect().x() + cell->leftmostPosition(false));
             }
         }
     }
diff --git a/WebCore/rendering/RenderTableSection.h b/WebCore/rendering/RenderTableSection.h
index 119ff9d..fce1e0f 100644
--- a/WebCore/rendering/RenderTableSection.h
+++ b/WebCore/rendering/RenderTableSection.h
@@ -136,10 +136,10 @@ private:
 
     virtual void removeChild(RenderObject* oldChild);
 
-    virtual int topmostPosition(bool includeOverflowInterior, bool includeSelf) const;
-    virtual int lowestPosition(bool includeOverflowInterior, bool includeSelf) const;
-    virtual int rightmostPosition(bool includeOverflowInterior, bool includeSelf) const;
-    virtual int leftmostPosition(bool includeOverflowInterior, bool includeSelf) const;
+    virtual int topmostPosition(bool includeOverflowInterior, bool includeSelf, ApplyTransform = IncludeTransform) const;
+    virtual int lowestPosition(bool includeOverflowInterior, bool includeSelf, ApplyTransform = IncludeTransform) const;
+    virtual int rightmostPosition(bool includeOverflowInterior, bool includeSelf, ApplyTransform = IncludeTransform) const;
+    virtual int leftmostPosition(bool includeOverflowInterior, bool includeSelf, ApplyTransform = IncludeTransform) const;
 
     virtual void paint(PaintInfo&, int tx, int ty);
     virtual void paintCell(RenderTableCell*, PaintInfo&, int tx, int ty);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list