[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:58:50 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit fa1f20eb7226a0ddf5223b7329c3c697c9956b2d
Author: zimmermann at webkit.org <zimmermann at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Sep 3 14:26:28 2010 +0000

    2010-09-03  Nikolas Zimmermann  <nzimmermann at rim.com>
    
            Reviewed by Dirk Schulze.
    
            SVG atlas map slider doesn't work properly
            https://bugs.webkit.org/show_bug.cgi?id=45107
    
            SVG 1.1 2nd edition relaxes hit testing rules. The outermost <svg> should react
            to mouse events, in standalone and compound documents, if the mouse location is
            within the intrinsic boundaries of the <svg> element.
    
            Tests: svg/custom/mouse-move-on-svg-container-standalone.svg
                   svg/custom/mouse-move-on-svg-container.xhtml
                   svg/custom/mouse-move-on-svg-root-standalone.svg
                   svg/custom/mouse-move-on-svg-root.xhtml
    
            * rendering/RenderSVGRoot.cpp:
            (WebCore::RenderSVGRoot::nodeAtPoint):
    
    2010-09-03  Nikolas Zimmermann  <nzimmermann at rim.com>
    
            Reviewed by Dirk Schulze.
    
            SVG atlas map slider doesn't work properly
            https://bugs.webkit.org/show_bug.cgi?id=45107
    
            * platform/mac/svg/custom/mouse-move-on-svg-container-expected.checksum: Added.
            * platform/mac/svg/custom/mouse-move-on-svg-container-expected.png: Added.
            * platform/mac/svg/custom/mouse-move-on-svg-container-expected.txt: Added.
            * platform/mac/svg/custom/mouse-move-on-svg-container-standalone-expected.checksum: Added.
            * platform/mac/svg/custom/mouse-move-on-svg-container-standalone-expected.png: Added.
            * platform/mac/svg/custom/mouse-move-on-svg-container-standalone-expected.txt: Added.
            * platform/mac/svg/custom/mouse-move-on-svg-root-expected.checksum: Added.
            * platform/mac/svg/custom/mouse-move-on-svg-root-expected.png: Added.
            * platform/mac/svg/custom/mouse-move-on-svg-root-expected.txt: Added.
            * platform/mac/svg/custom/mouse-move-on-svg-root-standalone-expected.checksum: Added.
            * platform/mac/svg/custom/mouse-move-on-svg-root-standalone-expected.png: Added.
            * platform/mac/svg/custom/mouse-move-on-svg-root-standalone-expected.txt: Added.
            * svg/custom/mouse-move-on-svg-container-standalone.svg: Added.
            * svg/custom/mouse-move-on-svg-container.xhtml: Added.
            * svg/custom/mouse-move-on-svg-root-standalone.svg: Added.
            * svg/custom/mouse-move-on-svg-root.xhtml: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66731 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 886cf7c..ccebd28 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,27 @@
+2010-09-03  Nikolas Zimmermann  <nzimmermann at rim.com>
+
+        Reviewed by Dirk Schulze.
+
+        SVG atlas map slider doesn't work properly
+        https://bugs.webkit.org/show_bug.cgi?id=45107
+
+        * platform/mac/svg/custom/mouse-move-on-svg-container-expected.checksum: Added.
+        * platform/mac/svg/custom/mouse-move-on-svg-container-expected.png: Added.
+        * platform/mac/svg/custom/mouse-move-on-svg-container-expected.txt: Added.
+        * platform/mac/svg/custom/mouse-move-on-svg-container-standalone-expected.checksum: Added.
+        * platform/mac/svg/custom/mouse-move-on-svg-container-standalone-expected.png: Added.
+        * platform/mac/svg/custom/mouse-move-on-svg-container-standalone-expected.txt: Added.
+        * platform/mac/svg/custom/mouse-move-on-svg-root-expected.checksum: Added.
+        * platform/mac/svg/custom/mouse-move-on-svg-root-expected.png: Added.
+        * platform/mac/svg/custom/mouse-move-on-svg-root-expected.txt: Added.
+        * platform/mac/svg/custom/mouse-move-on-svg-root-standalone-expected.checksum: Added.
+        * platform/mac/svg/custom/mouse-move-on-svg-root-standalone-expected.png: Added.
+        * platform/mac/svg/custom/mouse-move-on-svg-root-standalone-expected.txt: Added.
+        * svg/custom/mouse-move-on-svg-container-standalone.svg: Added.
+        * svg/custom/mouse-move-on-svg-container.xhtml: Added.
+        * svg/custom/mouse-move-on-svg-root-standalone.svg: Added.
+        * svg/custom/mouse-move-on-svg-root.xhtml: Added.
+
 2010-09-03  Pavel Podivilov  <podivilov at chromium.org>
 
         Reviewed by Yury Semikhatsky.
diff --git a/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-container-expected.checksum b/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-container-expected.checksum
new file mode 100644
index 0000000..d8d6c77
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-container-expected.checksum
@@ -0,0 +1 @@
+8dc7b913180a309ae65caf05d9eaebbf
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-container-expected.png b/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-container-expected.png
new file mode 100644
index 0000000..793f202
Binary files /dev/null and b/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-container-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-container-expected.txt b/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-container-expected.txt
new file mode 100644
index 0000000..95b550e
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-container-expected.txt
@@ -0,0 +1,14 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x410
+  RenderBlock {html} at (0,0) size 800x410
+    RenderBody {body} at (0,0) size 800x410
+      RenderSVGRoot {svg} at (45,33) size 361x373
+        RenderSVGContainer {g} at (303,303) size 100x100
+          RenderPath {circle} at (303,303) size 100x100 [fill={[type=SOLID] [color=#008000]}] [data="M400.00,350.00 L399.90,353.14 L399.61,356.27 L399.11,359.37 L398.43,362.43 L397.55,365.45 L396.49,368.41 L395.24,371.29 L393.82,374.09 L392.22,376.79 L390.45,379.39 L388.53,381.87 L386.45,384.23 L384.23,386.45 L381.87,388.53 L379.39,390.45 L376.79,392.22 L374.09,393.82 L371.29,395.24 L368.41,396.49 L365.45,397.55 L362.43,398.43 L359.37,399.11 L356.27,399.61 L353.14,399.90 L350.00,400.00 L346.86,399.90 L343.73,399.61 L340.63,399.11 L337.57,398.43 L334.55,397.55 L331.59,396.49 L328.71,395.24 L325.91,393.82 L323.21,392.22 L320.61,390.45 L318.13,388.53 L315.77,386.45 L313.55,384.23 L311.47,381.87 L309.55,379.39 L307.78,376.79 L306.18,374.09 L304.76,371.29 L303.51,368.41 L302.45,365.45 L301.57,362.43 L300.89,359.37 L300.39,356.27 L300.10,353.14 L300.00,350.00 L300.10,346.86 L300.39,343.73 L300.89,340.63 L301.57,337.57 L302.45,334.55 L303.51,331.59 L304.76,328.71 L306.18,325.91 L307.78,323.21 L309.55,320.61 L311.47,318.13 L313.55,315.77 L315.77,313.55 L318.13,311.47 L320.61,309.55 L323.21,307.78 L325.91,306.18 L328.71,304.76 L331.59,303.51 L334.55,302.45 L337.57,301.57 L340.63,300.89 L343.73,300.39 L346.86,300.10 L350.00,300.00 L353.14,300.10 L356.27,300.39 L359.37,300.89 L362.43,301.57 L365.45,302.45 L368.41,303.51 L371.29,304.76 L374.09,306.18 L376.79,307.78 L379.39,309.55 L381.87,311.47 L384.23,313.55 L386.45,315.77 L388.53,318.13 L390.45,320.61 L392.22,323.21 L393.82,325.91 L395.24,328.71 L396.49,331.59 L397.55,334.55 L398.43,337.57 L399.11,340.63 L399.61,343.73 L399.90,346.86 Z"]
+        RenderSVGText {text} at (48,36) size 304x18 contains 1 chunk(s)
+          RenderSVGInlineText {#text} at (0,0) size 304x18
+            chunk 1 (middle anchor) text run 1 at (48.50,50.00) startOffset 0 endOffset 49 width 303.00: "The circle should stay in the bottom-right corner"
+      RenderText {#text} at (0,0) size 0x0
+      RenderText {#text} at (0,0) size 0x0
+caret: position 49 of child 0 {#text} of child 3 {text} of child 1 {svg} of body
diff --git a/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-container-standalone-expected.checksum b/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-container-standalone-expected.checksum
new file mode 100644
index 0000000..d8d6c77
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-container-standalone-expected.checksum
@@ -0,0 +1 @@
+8dc7b913180a309ae65caf05d9eaebbf
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-container-standalone-expected.png b/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-container-standalone-expected.png
new file mode 100644
index 0000000..793f202
Binary files /dev/null and b/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-container-standalone-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-container-standalone-expected.txt b/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-container-standalone-expected.txt
new file mode 100644
index 0000000..5f9d3b6
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-container-standalone-expected.txt
@@ -0,0 +1,10 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 406x406
+  RenderSVGRoot {svg} at (45,33) size 361x373
+    RenderSVGContainer {g} at (303,303) size 100x100
+      RenderPath {circle} at (303,303) size 100x100 [fill={[type=SOLID] [color=#008000]}] [data="M400.00,350.00 L399.90,353.14 L399.61,356.27 L399.11,359.37 L398.43,362.43 L397.55,365.45 L396.49,368.41 L395.24,371.29 L393.82,374.09 L392.22,376.79 L390.45,379.39 L388.53,381.87 L386.45,384.23 L384.23,386.45 L381.87,388.53 L379.39,390.45 L376.79,392.22 L374.09,393.82 L371.29,395.24 L368.41,396.49 L365.45,397.55 L362.43,398.43 L359.37,399.11 L356.27,399.61 L353.14,399.90 L350.00,400.00 L346.86,399.90 L343.73,399.61 L340.63,399.11 L337.57,398.43 L334.55,397.55 L331.59,396.49 L328.71,395.24 L325.91,393.82 L323.21,392.22 L320.61,390.45 L318.13,388.53 L315.77,386.45 L313.55,384.23 L311.47,381.87 L309.55,379.39 L307.78,376.79 L306.18,374.09 L304.76,371.29 L303.51,368.41 L302.45,365.45 L301.57,362.43 L300.89,359.37 L300.39,356.27 L300.10,353.14 L300.00,350.00 L300.10,346.86 L300.39,343.73 L300.89,340.63 L301.57,337.57 L302.45,334.55 L303.51,331.59 L304.76,328.71 L306.18,325.91 L307.78,323.21 L309.55,320.61 L311.47,318.13 L313.55,315.77 L315.77,313.55 L318.13,311.47 L320.61,309.55 L323.21,307.78 L325.91,306.18 L328.71,304.76 L331.59,303.51 L334.55,302.45 L337.57,301.57 L340.63,300.89 L343.73,300.39 L346.86,300.10 L350.00,300.00 L353.14,300.10 L356.27,300.39 L359.37,300.89 L362.43,301.57 L365.45,302.45 L368.41,303.51 L371.29,304.76 L374.09,306.18 L376.79,307.78 L379.39,309.55 L381.87,311.47 L384.23,313.55 L386.45,315.77 L388.53,318.13 L390.45,320.61 L392.22,323.21 L393.82,325.91 L395.24,328.71 L396.49,331.59 L397.55,334.55 L398.43,337.57 L399.11,340.63 L399.61,343.73 L399.90,346.86 Z"]
+    RenderSVGText {text} at (48,36) size 304x18 contains 1 chunk(s)
+      RenderSVGInlineText {#text} at (0,0) size 304x18
+        chunk 1 (middle anchor) text run 1 at (48.50,50.00) startOffset 0 endOffset 49 width 303.00: "The circle should stay in the bottom-right corner"
+caret: position 49 of child 0 {#text} of child 3 {text} of child 0 {svg} of document
diff --git a/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-root-expected.checksum b/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-root-expected.checksum
new file mode 100644
index 0000000..3e129b3
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-root-expected.checksum
@@ -0,0 +1 @@
+4051025564bbd888d755df12a6a0ba36
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-root-expected.png b/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-root-expected.png
new file mode 100644
index 0000000..bb6083c
Binary files /dev/null and b/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-root-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-root-expected.txt b/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-root-expected.txt
new file mode 100644
index 0000000..e9c9892
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-root-expected.txt
@@ -0,0 +1,13 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x410
+  RenderBlock {html} at (0,0) size 800x410
+    RenderBody {body} at (0,0) size 800x410
+      RenderSVGRoot {svg} at (90,33) size 226x223
+        RenderPath {circle} at (150,150) size 100x100 [fill={[type=SOLID] [color=#008000]}] [data="M247.00,197.00 L246.90,200.14 L246.61,203.27 L246.11,206.37 L245.43,209.43 L244.55,212.45 L243.49,215.41 L242.24,218.29 L240.82,221.09 L239.22,223.79 L237.45,226.39 L235.53,228.87 L233.45,231.23 L231.23,233.45 L228.87,235.53 L226.39,237.45 L223.79,239.22 L221.09,240.82 L218.29,242.24 L215.41,243.49 L212.45,244.55 L209.43,245.43 L206.37,246.11 L203.27,246.61 L200.14,246.90 L197.00,247.00 L193.86,246.90 L190.73,246.61 L187.63,246.11 L184.57,245.43 L181.55,244.55 L178.59,243.49 L175.71,242.24 L172.91,240.82 L170.21,239.22 L167.61,237.45 L165.13,235.53 L162.77,233.45 L160.55,231.23 L158.47,228.87 L156.55,226.39 L154.78,223.79 L153.18,221.09 L151.76,218.29 L150.51,215.41 L149.45,212.45 L148.57,209.43 L147.89,206.37 L147.39,203.27 L147.10,200.14 L147.00,197.00 L147.10,193.86 L147.39,190.73 L147.89,187.63 L148.57,184.57 L149.45,181.55 L150.51,178.59 L151.76,175.71 L153.18,172.91 L154.78,170.21 L156.55,167.61 L158.47,165.13 L160.55,162.77 L162.77,160.55 L165.13,158.47 L167.61,156.55 L170.21,154.78 L172.91,153.18 L175.71,151.76 L178.59,150.51 L181.55,149.45 L184.57,148.57 L187.63,147.89 L190.73,147.39 L193.86,147.10 L197.00,147.00 L200.14,147.10 L203.27,147.39 L206.37,147.89 L209.43,148.57 L212.45,149.45 L215.41,150.51 L218.29,151.76 L221.09,153.18 L223.79,154.78 L226.39,156.55 L228.87,158.47 L231.23,160.55 L233.45,162.77 L235.53,165.13 L237.45,167.61 L239.22,170.21 L240.82,172.91 L242.24,175.71 L243.49,178.59 L244.55,181.55 L245.43,184.57 L246.11,187.63 L246.61,190.73 L246.90,193.86 Z"]
+        RenderSVGText {text} at (93,36) size 214x18 contains 1 chunk(s)
+          RenderSVGInlineText {#text} at (0,0) size 214x18
+            chunk 1 (middle anchor) text run 1 at (93.00,50.00) startOffset 0 endOffset 34 width 214.00: "The circle should be in the middle"
+      RenderText {#text} at (0,0) size 0x0
+      RenderText {#text} at (0,0) size 0x0
+caret: position 34 of child 0 {#text} of child 3 {text} of child 1 {svg} of body
diff --git a/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-root-standalone-expected.checksum b/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-root-standalone-expected.checksum
new file mode 100644
index 0000000..3e129b3
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-root-standalone-expected.checksum
@@ -0,0 +1 @@
+4051025564bbd888d755df12a6a0ba36
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-root-standalone-expected.png b/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-root-standalone-expected.png
new file mode 100644
index 0000000..bb6083c
Binary files /dev/null and b/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-root-standalone-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-root-standalone-expected.txt b/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-root-standalone-expected.txt
new file mode 100644
index 0000000..5d59af7
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-root-standalone-expected.txt
@@ -0,0 +1,9 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 406x406
+  RenderSVGRoot {svg} at (90,33) size 226x223
+    RenderPath {circle} at (150,150) size 100x100 [fill={[type=SOLID] [color=#008000]}] [data="M247.00,197.00 L246.90,200.14 L246.61,203.27 L246.11,206.37 L245.43,209.43 L244.55,212.45 L243.49,215.41 L242.24,218.29 L240.82,221.09 L239.22,223.79 L237.45,226.39 L235.53,228.87 L233.45,231.23 L231.23,233.45 L228.87,235.53 L226.39,237.45 L223.79,239.22 L221.09,240.82 L218.29,242.24 L215.41,243.49 L212.45,244.55 L209.43,245.43 L206.37,246.11 L203.27,246.61 L200.14,246.90 L197.00,247.00 L193.86,246.90 L190.73,246.61 L187.63,246.11 L184.57,245.43 L181.55,244.55 L178.59,243.49 L175.71,242.24 L172.91,240.82 L170.21,239.22 L167.61,237.45 L165.13,235.53 L162.77,233.45 L160.55,231.23 L158.47,228.87 L156.55,226.39 L154.78,223.79 L153.18,221.09 L151.76,218.29 L150.51,215.41 L149.45,212.45 L148.57,209.43 L147.89,206.37 L147.39,203.27 L147.10,200.14 L147.00,197.00 L147.10,193.86 L147.39,190.73 L147.89,187.63 L148.57,184.57 L149.45,181.55 L150.51,178.59 L151.76,175.71 L153.18,172.91 L154.78,170.21 L156.55,167.61 L158.47,165.13 L160.55,162.77 L162.77,160.55 L165.13,158.47 L167.61,156.55 L170.21,154.78 L172.91,153.18 L175.71,151.76 L178.59,150.51 L181.55,149.45 L184.57,148.57 L187.63,147.89 L190.73,147.39 L193.86,147.10 L197.00,147.00 L200.14,147.10 L203.27,147.39 L206.37,147.89 L209.43,148.57 L212.45,149.45 L215.41,150.51 L218.29,151.76 L221.09,153.18 L223.79,154.78 L226.39,156.55 L228.87,158.47 L231.23,160.55 L233.45,162.77 L235.53,165.13 L237.45,167.61 L239.22,170.21 L240.82,172.91 L242.24,175.71 L243.49,178.59 L244.55,181.55 L245.43,184.57 L246.11,187.63 L246.61,190.73 L246.90,193.86 Z"]
+    RenderSVGText {text} at (93,36) size 214x18 contains 1 chunk(s)
+      RenderSVGInlineText {#text} at (0,0) size 214x18
+        chunk 1 (middle anchor) text run 1 at (93.00,50.00) startOffset 0 endOffset 34 width 214.00: "The circle should be in the middle"
+caret: position 34 of child 0 {#text} of child 3 {text} of child 0 {svg} of document
diff --git a/LayoutTests/svg/custom/mouse-move-on-svg-container-standalone.svg b/LayoutTests/svg/custom/mouse-move-on-svg-container-standalone.svg
new file mode 100644
index 0000000..cfe6a3e
--- /dev/null
+++ b/LayoutTests/svg/custom/mouse-move-on-svg-container-standalone.svg
@@ -0,0 +1,44 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400" style="border: solid">
+    <g>
+        <circle cx="350" cy="350" r="50" fill="green" onmousedown="startMove()"/>
+    </g>
+    <text x="200" y="50" text-anchor="middle">The circle should stay in the bottom-right corner</text>
+    <script>
+        var root = document.getElementsByTagName("svg")[0];
+        var container = document.getElementsByTagName("g")[0];
+        var circle = document.getElementsByTagName("circle")[0];
+    
+        function move(evt) {
+            var matrix = container.getScreenCTM();
+            var point = root.createSVGPoint();
+            point.x = evt.clientX;
+            point.y = evt.clientY;
+            point = point.matrixTransform(matrix.inverse());
+            circle.cx.baseVal.value = point.x;
+            circle.cy.baseVal.value = point.y;
+        }
+    
+        function startMove() {
+            container.addEventListener("mousemove", move, false);
+            root.addEventListener("mouseup", stopMove, false);
+        }
+    
+        function stopMove() {
+            container.removeEventListener("mousemove", move, false);
+            root.removeEventListener("mouseup", stopMove, false);
+    
+            if (window.layoutTestController)
+                layoutTestController.notifyDone();
+        }
+    
+        if (window.layoutTestController)
+            layoutTestController.waitUntilDone();
+    
+        if (window.eventSender) {
+            eventSender.mouseMoveTo(350, 350);
+            eventSender.mouseDown();
+            eventSender.mouseMoveTo(200, 200);
+            eventSender.mouseUp();
+        }
+    </script>
+</svg>
diff --git a/LayoutTests/svg/custom/mouse-move-on-svg-container.xhtml b/LayoutTests/svg/custom/mouse-move-on-svg-container.xhtml
new file mode 100644
index 0000000..989de3e
--- /dev/null
+++ b/LayoutTests/svg/custom/mouse-move-on-svg-container.xhtml
@@ -0,0 +1,48 @@
+<html xmlns='http://www.w3.org/1999/xhtml'>
+<body style="margin: 0px; padding: 0px">
+<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400" style="border: solid">
+    <g>
+        <circle cx="350" cy="350" r="50" fill="green" onmousedown="startMove()"/>
+    </g>
+    <text x="200" y="50" text-anchor="middle">The circle should stay in the bottom-right corner</text>
+</svg>
+<script>
+    var root = document.getElementsByTagName("svg")[0];
+    var container = document.getElementsByTagName("g")[0];
+    var circle = document.getElementsByTagName("circle")[0];
+
+    function move(evt) {
+        var matrix = container.getScreenCTM();
+        var point = root.createSVGPoint();
+        point.x = evt.clientX;
+        point.y = evt.clientY;
+        point = point.matrixTransform(matrix.inverse());
+        circle.cx.baseVal.value = point.x;
+        circle.cy.baseVal.value = point.y;
+    }
+
+    function startMove() {
+        container.addEventListener("mousemove", move, false);
+        root.addEventListener("mouseup", stopMove, false);
+    }
+
+    function stopMove() {
+        container.removeEventListener("mousemove", move, false);
+        root.removeEventListener("mouseup", stopMove, false);
+
+        if (window.layoutTestController)
+            layoutTestController.notifyDone();
+    }
+
+    if (window.layoutTestController)
+        layoutTestController.waitUntilDone();
+
+    if (window.eventSender) {
+        eventSender.mouseMoveTo(350, 350);
+        eventSender.mouseDown();
+        eventSender.mouseMoveTo(200, 200);
+        eventSender.mouseUp();
+    }
+</script>
+</body>
+</html>
diff --git a/LayoutTests/svg/custom/mouse-move-on-svg-root-standalone.svg b/LayoutTests/svg/custom/mouse-move-on-svg-root-standalone.svg
new file mode 100644
index 0000000..3fcba11
--- /dev/null
+++ b/LayoutTests/svg/custom/mouse-move-on-svg-root-standalone.svg
@@ -0,0 +1,41 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400" style="border: solid">
+    <circle cx="350" cy="350" r="50" fill="green" onmousedown="startMove()"/>
+    <text x="200" y="50" text-anchor="middle">The circle should be in the middle</text>
+    <script>
+        var root = document.getElementsByTagName("svg")[0];
+        var circle = document.getElementsByTagName("circle")[0];
+    
+        function move(evt) {
+            var matrix = root.getScreenCTM();
+            var point = root.createSVGPoint();
+            point.x = evt.clientX;
+            point.y = evt.clientY;
+            point = point.matrixTransform(matrix.inverse());
+            circle.cx.baseVal.value = point.x;
+            circle.cy.baseVal.value = point.y;
+        }
+    
+        function startMove() {
+            root.addEventListener("mousemove", move, false);
+            root.addEventListener("mouseup", stopMove, false);
+        }
+    
+        function stopMove() {
+            root.removeEventListener("mousemove", move, false);
+            root.removeEventListener("mouseup", stopMove, false);
+    
+            if (window.layoutTestController)
+                layoutTestController.notifyDone();
+        }
+    
+        if (window.layoutTestController)
+            layoutTestController.waitUntilDone();
+    
+        if (window.eventSender) {
+            eventSender.mouseMoveTo(350, 350);
+            eventSender.mouseDown();
+            eventSender.mouseMoveTo(200, 200);
+            eventSender.mouseUp();
+        }
+    </script>
+</svg>
diff --git a/LayoutTests/svg/custom/mouse-move-on-svg-root.xhtml b/LayoutTests/svg/custom/mouse-move-on-svg-root.xhtml
new file mode 100644
index 0000000..ee37eb6
--- /dev/null
+++ b/LayoutTests/svg/custom/mouse-move-on-svg-root.xhtml
@@ -0,0 +1,45 @@
+<html xmlns='http://www.w3.org/1999/xhtml'>
+<body style="margin: 0px; padding: 0px">
+<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400" style="border: solid">
+    <circle cx="350" cy="350" r="50" fill="green" onmousedown="startMove()"/>
+    <text x="200" y="50" text-anchor="middle">The circle should be in the middle</text>
+</svg>
+<script>
+    var root = document.getElementsByTagName("svg")[0];
+    var circle = document.getElementsByTagName("circle")[0];
+
+    function move(evt) {
+        var matrix = root.getScreenCTM();
+        var point = root.createSVGPoint();
+        point.x = evt.clientX;
+        point.y = evt.clientY;
+        point = point.matrixTransform(matrix.inverse());
+        circle.cx.baseVal.value = point.x;
+        circle.cy.baseVal.value = point.y;
+    }
+
+    function startMove() {
+        root.addEventListener("mousemove", move, false);
+        root.addEventListener("mouseup", stopMove, false);
+    }
+
+    function stopMove() {
+        root.removeEventListener("mousemove", move, false);
+        root.removeEventListener("mouseup", stopMove, false);
+
+        if (window.layoutTestController)
+            layoutTestController.notifyDone();
+    }
+
+    if (window.layoutTestController)
+        layoutTestController.waitUntilDone();
+
+    if (window.eventSender) {
+        eventSender.mouseMoveTo(350, 350);
+        eventSender.mouseDown();
+        eventSender.mouseMoveTo(200, 200);
+        eventSender.mouseUp();
+    }
+</script>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 9e6ea89..ea62cc6 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2010-09-03  Nikolas Zimmermann  <nzimmermann at rim.com>
+
+        Reviewed by Dirk Schulze.
+
+        SVG atlas map slider doesn't work properly
+        https://bugs.webkit.org/show_bug.cgi?id=45107
+
+        SVG 1.1 2nd edition relaxes hit testing rules. The outermost <svg> should react
+        to mouse events, in standalone and compound documents, if the mouse location is
+        within the intrinsic boundaries of the <svg> element.
+
+        Tests: svg/custom/mouse-move-on-svg-container-standalone.svg
+               svg/custom/mouse-move-on-svg-container.xhtml
+               svg/custom/mouse-move-on-svg-root-standalone.svg
+               svg/custom/mouse-move-on-svg-root.xhtml
+
+        * rendering/RenderSVGRoot.cpp:
+        (WebCore::RenderSVGRoot::nodeAtPoint):
+
 2010-09-03  Pavel Podivilov  <podivilov at chromium.org>
 
         Reviewed by Yury Semikhatsky.
diff --git a/WebCore/rendering/RenderSVGRoot.cpp b/WebCore/rendering/RenderSVGRoot.cpp
index 3fd439c..4e23c42 100644
--- a/WebCore/rendering/RenderSVGRoot.cpp
+++ b/WebCore/rendering/RenderSVGRoot.cpp
@@ -349,8 +349,16 @@ bool RenderSVGRoot::nodeAtPoint(const HitTestRequest& request, HitTestResult& re
         }
     }
 
-    // Spec: Only graphical elements can be targeted by the mouse, so we don't check self here.
-    // 16.4: "If there are no graphics elements whose relevant graphics content is under the pointer (i.e., there is no target element), the event is not dispatched."
+    // If we didn't early exit above, we've just hit the container <svg> element. Unlike SVG 1.1, 2nd Edition allows container elements to be hit.
+    if (hitTestAction == HitTestBlockBackground) {
+        // Only return true here, if the last hit testing phase 'BlockBackground' is executed. If we'd return true in the 'Foreground' phase,
+        // hit testing would stop immediately. For SVG only trees this doesn't matter. Though when we have a <foreignObject> subtree we need
+        // to be able to detect hits on the background of a <div> element. If we'd return true here in the 'Foreground' phase, we are not able 
+        // to detect these hits anymore.
+        updateHitTestResult(result, roundedIntPoint(localPoint));
+        return true;
+    }
+
     return false;
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list