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

zimmermann at webkit.org zimmermann at webkit.org
Wed Dec 22 12:41:24 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 059ae2834cc2feff9423643295542d22a595a1c1
Author: zimmermann at webkit.org <zimmermann at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Aug 27 08:08:13 2010 +0000

    2010-08-27  Nikolas Zimmermann  <nzimmermann at rim.com>
    
            Reviewed by Dirk Schulze.
    
            SVGLocatable.getScreenCTM ignores scrolling
            https://bugs.webkit.org/show_bug.cgi?id=44083
    
            getScreenCTM needs to include the FrameViews scrollOffset in the e/f parameters of the AffineTransform.
            Adding three new tests, which cover scrolling & getScreenCTM in large svgs with scrollbars, and with (nested) divs in overflow="scroll" mode.
    
            Tests: svg/custom/getscreenctm-in-scrollable-div-area-nested.xhtml
                   svg/custom/getscreenctm-in-scrollable-div-area.xhtml
                   svg/custom/getscreenctm-in-scrollable-svg-area.xhtml
    
            * svg/SVGSVGElement.cpp:
            (WebCore::SVGSVGElement::localCoordinateSpaceTransform):
    
    2010-08-27  Nikolas Zimmermann  <nzimmermann at rim.com>
    
            Reviewed by Dirk Schulze.
    
            SVGLocatable.getScreenCTM ignores scrolling
            https://bugs.webkit.org/show_bug.cgi?id=44083
    
            * platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-expected.checksum: Added.
            * platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-expected.png: Added.
            * platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-expected.txt: Added.
            * platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.checksum: Added.
            * platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.png: Added.
            * platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.txt: Added.
            * platform/mac/svg/custom/getscreenctm-in-scrollable-svg-area-expected.checksum: Added.
            * platform/mac/svg/custom/getscreenctm-in-scrollable-svg-area-expected.png: Added.
            * platform/mac/svg/custom/getscreenctm-in-scrollable-svg-area-expected.txt: Added.
            * svg/custom/getscreenctm-in-scrollable-div-area-nested.xhtml: Added.
            * svg/custom/getscreenctm-in-scrollable-div-area.xhtml: Added.
            * svg/custom/getscreenctm-in-scrollable-svg-area.xhtml: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66187 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index c3c4f6e..110f5b5 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,23 @@
+2010-08-27  Nikolas Zimmermann  <nzimmermann at rim.com>
+
+        Reviewed by Dirk Schulze.
+
+        SVGLocatable.getScreenCTM ignores scrolling
+        https://bugs.webkit.org/show_bug.cgi?id=44083
+
+        * platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-expected.checksum: Added.
+        * platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-expected.png: Added.
+        * platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-expected.txt: Added.
+        * platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.checksum: Added.
+        * platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.png: Added.
+        * platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.txt: Added.
+        * platform/mac/svg/custom/getscreenctm-in-scrollable-svg-area-expected.checksum: Added.
+        * platform/mac/svg/custom/getscreenctm-in-scrollable-svg-area-expected.png: Added.
+        * platform/mac/svg/custom/getscreenctm-in-scrollable-svg-area-expected.txt: Added.
+        * svg/custom/getscreenctm-in-scrollable-div-area-nested.xhtml: Added.
+        * svg/custom/getscreenctm-in-scrollable-div-area.xhtml: Added.
+        * svg/custom/getscreenctm-in-scrollable-svg-area.xhtml: Added.
+
 2010-08-26  Philippe Normand  <pnormand at igalia.com>
 
         Reviewed by Martin Robinson.
diff --git a/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-expected.checksum b/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-expected.checksum
new file mode 100644
index 0000000..d7f38a3
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-expected.checksum
@@ -0,0 +1 @@
+ca5e87199574f824ce320387d47388e7
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-expected.png b/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-expected.png
new file mode 100644
index 0000000..d745d74
Binary files /dev/null and b/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-expected.txt b/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-expected.txt
new file mode 100644
index 0000000..d179915
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-expected.txt
@@ -0,0 +1,14 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x550
+  RenderBlock {html} at (0,0) size 800x550
+    RenderBody {body} at (0,0) size 800x550
+layer at (0,0) size 750x550 clip at (0,0) size 735x535 scrollY 1700 scrollHeight 4010
+  RenderBlock {div} at (0,0) size 750x550
+    RenderSVGRoot {svg} at (271,250) size 464x154
+      RenderPath {rect} at (350,250) size 100x100 [fill={[type=SOLID] [color=#000080] [opacity=0.50]}] [data="M350.00,1950.00 L450.00,1950.00 L450.00,2050.00 L350.00,2050.00 Z"]
+      RenderPath {circle} at (350,250) size 100x100 [fill={[type=SOLID] [color=#F08080]}] [data="M450.00,2000.00 L449.90,2003.14 L449.61,2006.27 L449.11,2009.37 L448.43,2012.43 L447.55,2015.45 L446.49,2018.41 L445.24,2021.29 L443.82,2024.09 L442.22,2026.79 L440.45,2029.39 L438.53,2031.87 L436.45,2034.23 L434.23,2036.45 L431.87,2038.53 L429.39,2040.45 L426.79,2042.22 L424.09,2043.82 L421.29,2045.24 L418.41,2046.49 L415.45,2047.55 L412.43,2048.43 L409.37,2049.11 L406.27,2049.61 L403.14,2049.90 L400.00,2050.00 L396.86,2049.90 L393.73,2049.61 L390.63,2049.11 L387.57,2048.43 L384.55,2047.55 L381.59,2046.49 L378.71,2045.24 L375.91,2043.82 L373.21,2042.22 L370.61,2040.45 L368.13,2038.53 L365.77,2036.45 L363.55,2034.23 L361.47,2031.87 L359.55,2029.39 L357.78,2026.79 L356.18,2024.09 L354.76,2021.29 L353.51,2018.41 L352.45,2015.45 L351.57,2012.43 L350.89,2009.37 L350.39,2006.27 L350.10,2003.14 L350.00,2000.00 L350.10,1996.86 L350.39,1993.73 L350.89,1990.63 L351.57,1987.57 L352.45,1984.55 L353.51,1981.59 L354.76,1978.71 L356.18,1975.91 L357.78,1973.21 L359.55,1970.61 L361.47,1968.13 L363.55,1965.77 L365.77,1963.55 L368.13,1961.47 L370.61,1959.55 L373.21,1957.78 L375.91,1956.18 L378.71,1954.76 L381.59,1953.51 L384.55,1952.45 L387.57,1951.57 L390.63,1950.89 L393.73,1950.39 L396.86,1950.10 L400.00,1950.00 L403.14,1950.10 L406.27,1950.39 L409.37,1950.89 L412.43,1951.57 L415.45,1952.45 L418.41,1953.51 L421.29,1954.76 L424.09,1956.18 L426.79,1957.78 L429.39,1959.55 L431.87,1961.47 L434.23,1963.55 L436.45,1965.77 L438.53,1968.13 L440.45,1970.61 L442.22,1973.21 L443.82,1975.91 L445.24,1978.71 L446.49,1981.59 L447.55,1984.55 L448.43,1987.57 L449.11,1990.63 L449.61,1993.73 L449.90,1996.86 Z"]
+      RenderSVGText {text} at (271,2086) size 258x18 contains 1 chunk(s)
+        RenderSVGInlineText {#text} at (0,0) size 258x18
+          chunk 1 (middle anchor) text run 1 at (271.00,2100.00) startOffset 0 endOffset 46 width 258.00: "The test passes if the circle sits in the rect"
+    RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.checksum b/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.checksum
new file mode 100644
index 0000000..8c1a2f8
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.checksum
@@ -0,0 +1 @@
+6c0dbf7d0d0f818ec4a600e8a59e0ae6
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.png b/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.png
new file mode 100644
index 0000000..c07b39a
Binary files /dev/null and b/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.txt b/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.txt
new file mode 100644
index 0000000..929fd2b
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.txt
@@ -0,0 +1,16 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x550
+  RenderBlock {html} at (0,0) size 800x550
+    RenderBody {body} at (0,0) size 800x550
+layer at (0,0) size 750x550 clip at (0,0) size 735x535 scrollY 300 scrollHeight 1000
+  RenderBlock {div} at (0,0) size 750x550
+layer at (0,-300) size 725x1000 backgroundClip at (0,0) size 725x535 clip at (0,0) size 710x535 outlineClip at (0,0) size 735x535 scrollY 1400 scrollHeight 4100
+  RenderBlock {div} at (0,0) size 725x1000
+    RenderSVGRoot {svg} at (271,250) size 439x154
+      RenderPath {rect} at (350,250) size 100x100 [fill={[type=SOLID] [color=#000080] [opacity=0.50]}] [data="M350.00,1950.00 L450.00,1950.00 L450.00,2050.00 L350.00,2050.00 Z"]
+      RenderPath {circle} at (350,250) size 100x100 [fill={[type=SOLID] [color=#F08080]}] [data="M450.00,2000.00 L449.90,2003.14 L449.61,2006.27 L449.11,2009.37 L448.43,2012.43 L447.55,2015.45 L446.49,2018.41 L445.24,2021.29 L443.82,2024.09 L442.22,2026.79 L440.45,2029.39 L438.53,2031.87 L436.45,2034.23 L434.23,2036.45 L431.87,2038.53 L429.39,2040.45 L426.79,2042.22 L424.09,2043.82 L421.29,2045.24 L418.41,2046.49 L415.45,2047.55 L412.43,2048.43 L409.37,2049.11 L406.27,2049.61 L403.14,2049.90 L400.00,2050.00 L396.86,2049.90 L393.73,2049.61 L390.63,2049.11 L387.57,2048.43 L384.55,2047.55 L381.59,2046.49 L378.71,2045.24 L375.91,2043.82 L373.21,2042.22 L370.61,2040.45 L368.13,2038.53 L365.77,2036.45 L363.55,2034.23 L361.47,2031.87 L359.55,2029.39 L357.78,2026.79 L356.18,2024.09 L354.76,2021.29 L353.51,2018.41 L352.45,2015.45 L351.57,2012.43 L350.89,2009.37 L350.39,2006.27 L350.10,2003.14 L350.00,2000.00 L350.10,1996.86 L350.39,1993.73 L350.89,1990.63 L351.57,1987.57 L352.45,1984.55 L353.51,1981.59 L354.76,1978.71 L356.18,1975.91 L357.78,1973.21 L359.55,1970.61 L361.47,1968.13 L363.55,1965.77 L365.77,1963.55 L368.13,1961.47 L370.61,1959.55 L373.21,1957.78 L375.91,1956.18 L378.71,1954.76 L381.59,1953.51 L384.55,1952.45 L387.57,1951.57 L390.63,1950.89 L393.73,1950.39 L396.86,1950.10 L400.00,1950.00 L403.14,1950.10 L406.27,1950.39 L409.37,1950.89 L412.43,1951.57 L415.45,1952.45 L418.41,1953.51 L421.29,1954.76 L424.09,1956.18 L426.79,1957.78 L429.39,1959.55 L431.87,1961.47 L434.23,1963.55 L436.45,1965.77 L438.53,1968.13 L440.45,1970.61 L442.22,1973.21 L443.82,1975.91 L445.24,1978.71 L446.49,1981.59 L447.55,1984.55 L448.43,1987.57 L449.11,1990.63 L449.61,1993.73 L449.90,1996.86 Z"]
+      RenderSVGText {text} at (271,2086) size 258x18 contains 1 chunk(s)
+        RenderSVGInlineText {#text} at (0,0) size 258x18
+          chunk 1 (middle anchor) text run 1 at (271.00,2100.00) startOffset 0 endOffset 46 width 258.00: "The test passes if the circle sits in the rect"
+    RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-svg-area-expected.checksum b/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-svg-area-expected.checksum
new file mode 100644
index 0000000..e3ec36e
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-svg-area-expected.checksum
@@ -0,0 +1 @@
+19c733751f0067b46e479632d1f04ea2
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-svg-area-expected.png b/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-svg-area-expected.png
new file mode 100644
index 0000000..3d78b5a
Binary files /dev/null and b/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-svg-area-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-svg-area-expected.txt b/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-svg-area-expected.txt
new file mode 100644
index 0000000..eeb20e8
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/custom/getscreenctm-in-scrollable-svg-area-expected.txt
@@ -0,0 +1,14 @@
+layer at (0,0) size 785x4004
+  RenderView at (0,0) size 785x600
+layer at (0,0) size 785x4004
+  RenderBlock {html} at (0,0) size 785x4004
+    RenderBody {body} at (0,0) size 785x4004
+      RenderSVGRoot {svg} at (271,1950) size 514x154
+        RenderPath {rect} at (350,1950) size 100x100 [fill={[type=SOLID] [color=#000080] [opacity=0.50]}] [data="M350.00,1950.00 L450.00,1950.00 L450.00,2050.00 L350.00,2050.00 Z"]
+        RenderPath {circle} at (350,1950) size 100x100 [fill={[type=SOLID] [color=#F08080]}] [data="M450.00,2000.00 L449.90,2003.14 L449.61,2006.27 L449.11,2009.37 L448.43,2012.43 L447.55,2015.45 L446.49,2018.41 L445.24,2021.29 L443.82,2024.09 L442.22,2026.79 L440.45,2029.39 L438.53,2031.87 L436.45,2034.23 L434.23,2036.45 L431.87,2038.53 L429.39,2040.45 L426.79,2042.22 L424.09,2043.82 L421.29,2045.24 L418.41,2046.49 L415.45,2047.55 L412.43,2048.43 L409.37,2049.11 L406.27,2049.61 L403.14,2049.90 L400.00,2050.00 L396.86,2049.90 L393.73,2049.61 L390.63,2049.11 L387.57,2048.43 L384.55,2047.55 L381.59,2046.49 L378.71,2045.24 L375.91,2043.82 L373.21,2042.22 L370.61,2040.45 L368.13,2038.53 L365.77,2036.45 L363.55,2034.23 L361.47,2031.87 L359.55,2029.39 L357.78,2026.79 L356.18,2024.09 L354.76,2021.29 L353.51,2018.41 L352.45,2015.45 L351.57,2012.43 L350.89,2009.37 L350.39,2006.27 L350.10,2003.14 L350.00,2000.00 L350.10,1996.86 L350.39,1993.73 L350.89,1990.63 L351.57,1987.57 L352.45,1984.55 L353.51,1981.59 L354.76,1978.71 L356.18,1975.91 L357.78,1973.21 L359.55,1970.61 L361.47,1968.13 L363.55,1965.77 L365.77,1963.55 L368.13,1961.47 L370.61,1959.55 L373.21,1957.78 L375.91,1956.18 L378.71,1954.76 L381.59,1953.51 L384.55,1952.45 L387.57,1951.57 L390.63,1950.89 L393.73,1950.39 L396.86,1950.10 L400.00,1950.00 L403.14,1950.10 L406.27,1950.39 L409.37,1950.89 L412.43,1951.57 L415.45,1952.45 L418.41,1953.51 L421.29,1954.76 L424.09,1956.18 L426.79,1957.78 L429.39,1959.55 L431.87,1961.47 L434.23,1963.55 L436.45,1965.77 L438.53,1968.13 L440.45,1970.61 L442.22,1973.21 L443.82,1975.91 L445.24,1978.71 L446.49,1981.59 L447.55,1984.55 L448.43,1987.57 L449.11,1990.63 L449.61,1993.73 L449.90,1996.86 Z"]
+        RenderSVGText {text} at (271,2086) size 258x18 contains 1 chunk(s)
+          RenderSVGInlineText {#text} at (0,0) size 258x18
+            chunk 1 (middle anchor) text run 1 at (271.00,2100.00) startOffset 0 endOffset 46 width 258.00: "The test passes if the circle sits in the rect"
+      RenderText {#text} at (0,0) size 0x0
+      RenderText {#text} at (0,0) size 0x0
+scrolled to 0,1700
diff --git a/LayoutTests/svg/custom/getscreenctm-in-scrollable-div-area-nested.xhtml b/LayoutTests/svg/custom/getscreenctm-in-scrollable-div-area-nested.xhtml
new file mode 100644
index 0000000..686a65f
--- /dev/null
+++ b/LayoutTests/svg/custom/getscreenctm-in-scrollable-div-area-nested.xhtml
@@ -0,0 +1,39 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+</head>
+<body style="margin: 0px; padding: 0px">
+
+<div style="overflow: scroll; width: 750px; height: 550px">
+<div style="overflow: scroll; width: 725px; height: 1000px">
+    <svg xmlns="http://www.w3.org/2000/svg" style="overflow: hidden;" width="100%" height="4096">
+        <rect x="350" y="1950" width="100" height="100" fill="navy" fill-opacity="0.5"/>
+        <circle r="50" fill="lightcoral"/>
+        <text text-anchor="middle" x="400" y="2100">The test passes if the circle sits in the rect</text>
+    </svg>
+</div>
+</div>
+
+<script type="text/javascript">
+var svg = document.getElementsByTagName("svg")[0];
+var dot = document.getElementsByTagName("circle")[0];
+var div1 = document.getElementsByTagName("div")[0];
+var div2 = document.getElementsByTagName("div")[1];
+
+window.addEventListener("mousemove", mousemove, false);
+div1.scrollTop = 300;
+div2.scrollTop = 1400;
+
+if (window.eventSender)
+    eventSender.mouseMoveTo(400, 300);
+
+function mousemove(evt) {
+    var point = svg.createSVGPoint();
+    point.x = evt.clientX;
+    point.y = evt.clientY;
+    point = point.matrixTransform(svg.getScreenCTM().inverse());
+    dot.setAttribute("cx", point.x);
+    dot.setAttribute("cy", point.y);
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/svg/custom/getscreenctm-in-scrollable-div-area.xhtml b/LayoutTests/svg/custom/getscreenctm-in-scrollable-div-area.xhtml
new file mode 100644
index 0000000..3ef5a1c
--- /dev/null
+++ b/LayoutTests/svg/custom/getscreenctm-in-scrollable-div-area.xhtml
@@ -0,0 +1,35 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+</head>
+<body style="margin: 0px; padding: 0px">
+
+<div style="overflow: scroll; width: 750px; height: 550px">
+    <svg xmlns="http://www.w3.org/2000/svg" style="overflow: hidden;" width="100%" height="4006">
+        <rect x="350" y="1950" width="100" height="100" fill="navy" fill-opacity="0.5"/>
+        <circle r="50" fill="lightcoral"/>
+        <text text-anchor="middle" x="400" y="2100">The test passes if the circle sits in the rect</text>
+    </svg>
+</div>
+
+<script type="text/javascript">
+var svg = document.getElementsByTagName("svg")[0];
+var dot = document.getElementsByTagName("circle")[0];
+var div = document.getElementsByTagName("div")[0];
+
+window.addEventListener("mousemove", mousemove, false);
+div.scrollTop = 1700;
+
+if (window.eventSender)
+    eventSender.mouseMoveTo(400, 300);
+
+function mousemove(evt) {
+    var point = svg.createSVGPoint();
+    point.x = evt.clientX;
+    point.y = evt.clientY;
+    point = point.matrixTransform(svg.getScreenCTM().inverse());
+    dot.setAttribute("cx", point.x);
+    dot.setAttribute("cy", point.y);
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/svg/custom/getscreenctm-in-scrollable-svg-area.xhtml b/LayoutTests/svg/custom/getscreenctm-in-scrollable-svg-area.xhtml
new file mode 100644
index 0000000..53a519c
--- /dev/null
+++ b/LayoutTests/svg/custom/getscreenctm-in-scrollable-svg-area.xhtml
@@ -0,0 +1,32 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+</head>
+<body style="margin: 0px; padding: 0px">
+
+<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="4000">
+    <rect x="350" y="1950" width="100" height="100" fill="navy" fill-opacity="0.5"/>
+    <circle r="50" fill="lightcoral"/>
+    <text text-anchor="middle" x="400" y="2100">The test passes if the circle sits in the rect</text>
+</svg>
+
+<script type="text/javascript">
+var svg = document.getElementsByTagName("svg")[0];
+var dot = document.getElementsByTagName("circle")[0];
+
+window.addEventListener("mousemove", mousemove, false);
+window.scrollTo(0, 1700);
+
+if (window.eventSender)
+    eventSender.mouseMoveTo(400, 300);
+
+function mousemove(evt) {
+    var point = svg.createSVGPoint();
+    point.x = evt.clientX;
+    point.y = evt.clientY;
+    point = point.matrixTransform(svg.getScreenCTM().inverse());
+    dot.setAttribute("cx", point.x);
+    dot.setAttribute("cy", point.y);
+}
+</script>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index c1a4cf9..88adc74 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-08-27  Nikolas Zimmermann  <nzimmermann at rim.com>
+
+        Reviewed by Dirk Schulze.
+
+        SVGLocatable.getScreenCTM ignores scrolling
+        https://bugs.webkit.org/show_bug.cgi?id=44083
+
+        getScreenCTM needs to include the FrameViews scrollOffset in the e/f parameters of the AffineTransform.
+        Adding three new tests, which cover scrolling & getScreenCTM in large svgs with scrollbars, and with (nested) divs in overflow="scroll" mode.
+
+        Tests: svg/custom/getscreenctm-in-scrollable-div-area-nested.xhtml
+               svg/custom/getscreenctm-in-scrollable-div-area.xhtml
+               svg/custom/getscreenctm-in-scrollable-svg-area.xhtml
+
+        * svg/SVGSVGElement.cpp:
+        (WebCore::SVGSVGElement::localCoordinateSpaceTransform):
+
 2010-08-25  Ryosuke Niwa  <rniwa at webkit.org>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/svg/SVGSVGElement.cpp b/WebCore/svg/SVGSVGElement.cpp
index b7f9717..6347726 100644
--- a/WebCore/svg/SVGSVGElement.cpp
+++ b/WebCore/svg/SVGSVGElement.cpp
@@ -472,6 +472,12 @@ AffineTransform SVGSVGElement::localCoordinateSpaceTransform(SVGLocatable::CTMSc
             // RenderSVGRoot::localToBorderBoxTransform() (called through mapLocalToContainer(), called from localToAbsolute())
             // also takes the viewBoxToViewTransform() into account, so we have to subtract it here (original cause of bug #27183)
             transform.translate(location.x() - viewBoxTransform.e(), location.y() - viewBoxTransform.f());
+
+            // Respect scroll offset.
+            if (FrameView* view = document()->view()) {
+                IntSize scrollOffset = view->scrollOffset();
+                transform.translate(-scrollOffset.width(), -scrollOffset.height());
+            }
         }
     }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list