Fixed Hit testing on Framesets when Frameset is transformed
authorfsamuel@chromium.org <fsamuel@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Sep 2011 04:44:39 +0000 (04:44 +0000)
committerfsamuel@chromium.org <fsamuel@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Sep 2011 04:44:39 +0000 (04:44 +0000)
https://bugs.webkit.org/show_bug.cgi?id=67740

Reviewed by Simon Fraser.

Source/WebCore:

Tests: fast/frames/frame-set-rotation-hit.html
       fast/frames/frame-set-scaling-hit.html

* rendering/RenderFrameSet.cpp:
(WebCore::RenderFrameSet::userResize):

LayoutTests:

* fast/frames/frame-set-rotation-hit-expected.png: Added.
* fast/frames/frame-set-rotation-hit-expected.txt: Added.
* fast/frames/frame-set-rotation-hit.html: Added.
* fast/frames/frame-set-scaling-hit-expected.png: Added.
* fast/frames/frame-set-scaling-hit-expected.txt: Added.
* fast/frames/frame-set-scaling-hit.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/frames/frame-set-rotation-hit-expected.png [new file with mode: 0644]
LayoutTests/fast/frames/frame-set-rotation-hit-expected.txt [new file with mode: 0644]
LayoutTests/fast/frames/frame-set-rotation-hit.html [new file with mode: 0644]
LayoutTests/fast/frames/frame-set-scaling-hit-expected.png [new file with mode: 0644]
LayoutTests/fast/frames/frame-set-scaling-hit-expected.txt [new file with mode: 0644]
LayoutTests/fast/frames/frame-set-scaling-hit.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderFrameSet.cpp

index 41cebf34da609057128b80839cdf89827eb8c3f1..f81f4a587645ab9dc8d3e7da39538cf6e59204d8 100644 (file)
@@ -1,3 +1,17 @@
+2011-09-29  Fady Samuel  <fsamuel@chromium.org>
+
+        Fixed Hit testing on Framesets when Frameset is transformed
+        https://bugs.webkit.org/show_bug.cgi?id=67740
+
+        Reviewed by Simon Fraser.
+
+        * fast/frames/frame-set-rotation-hit-expected.png: Added.
+        * fast/frames/frame-set-rotation-hit-expected.txt: Added.
+        * fast/frames/frame-set-rotation-hit.html: Added.
+        * fast/frames/frame-set-scaling-hit-expected.png: Added.
+        * fast/frames/frame-set-scaling-hit-expected.txt: Added.
+        * fast/frames/frame-set-scaling-hit.html: Added.
+
 2011-09-29  Adam Barth  <abarth@webkit.org>
 
         These tests can also time out.
diff --git a/LayoutTests/fast/frames/frame-set-rotation-hit-expected.png b/LayoutTests/fast/frames/frame-set-rotation-hit-expected.png
new file mode 100644 (file)
index 0000000..947f436
Binary files /dev/null and b/LayoutTests/fast/frames/frame-set-rotation-hit-expected.png differ
diff --git a/LayoutTests/fast/frames/frame-set-rotation-hit-expected.txt b/LayoutTests/fast/frames/frame-set-rotation-hit-expected.txt
new file mode 100644 (file)
index 0000000..cb69b45
--- /dev/null
@@ -0,0 +1,18 @@
+layer at (0,0) size 800x800
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderFrameSet {FRAMESET} at (0,0) size 800x600 [bgcolor=#FF0000]
+    RenderFrame {FRAME} at (0,0) size 398x600
+      layer at (0,0) size 398x600
+        RenderView at (0,0) size 398x600
+      layer at (0,0) size 398x600
+        RenderBlock {HTML} at (0,0) size 398x600
+          RenderBody {BODY} at (8,8) size 382x584 [bgcolor=#008000]
+    RenderFrame {FRAME} at (404,0) size 396x600
+      layer at (0,0) size 396x600
+        RenderView at (0,0) size 396x600
+      layer at (0,0) size 396x600
+        RenderBlock {HTML} at (0,0) size 396x600
+          RenderBody {BODY} at (8,8) size 380x584 [bgcolor=#008000]
diff --git a/LayoutTests/fast/frames/frame-set-rotation-hit.html b/LayoutTests/fast/frames/frame-set-rotation-hit.html
new file mode 100644 (file)
index 0000000..b19774d
--- /dev/null
@@ -0,0 +1,25 @@
+<html>
+  <head>
+    <title>FrameSet Rotation Hit Test</title>
+
+    <script>
+        function init() {
+            if (!window.eventSender)
+                return;
+            // Scale the page and resize the frames to verify hit testing on the frameset
+            eventSender.scalePageBy(0.5, 0, 0);
+            var leftPanelWidth = window.innerWidth / 8;
+            eventSender.mouseMoveTo(window.innerWidth / 4, leftPanelWidth);
+            eventSender.mouseDown();
+            eventSender.mouseMoveTo(window.innerWidth / 4, 2 * leftPanelWidth);
+            eventSender.mouseUp();
+        }
+        window.onload = init;
+    </script>
+  </head>
+  <!--rotate the frameset and translate it to make sure the entire frameset is visible after scaling-->
+  <frameset style="background-color: red; -webkit-transform: rotate(90deg) translate(100px, 0px);" cols="25%,75%">
+    <frame src="data:text/html,<body bgcolor='green'></body>">
+    <frame src="data:text/html,<body bgcolor='green'></body>">
+  </frameset>
+</html>
diff --git a/LayoutTests/fast/frames/frame-set-scaling-hit-expected.png b/LayoutTests/fast/frames/frame-set-scaling-hit-expected.png
new file mode 100644 (file)
index 0000000..e5429cf
Binary files /dev/null and b/LayoutTests/fast/frames/frame-set-scaling-hit-expected.png differ
diff --git a/LayoutTests/fast/frames/frame-set-scaling-hit-expected.txt b/LayoutTests/fast/frames/frame-set-scaling-hit-expected.txt
new file mode 100644 (file)
index 0000000..a408087
--- /dev/null
@@ -0,0 +1,17 @@
+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
+    RenderFrameSet {FRAMESET} at (0,0) size 800x600 [bgcolor=#FF0000]
+      RenderFrame {FRAME} at (0,0) size 398x600
+        layer at (0,0) size 398x600
+          RenderView at (0,0) size 398x600
+        layer at (0,0) size 398x600
+          RenderBlock {HTML} at (0,0) size 398x600
+            RenderBody {BODY} at (8,8) size 382x584 [bgcolor=#008000]
+      RenderFrame {FRAME} at (404,0) size 396x600
+        layer at (0,0) size 396x600
+          RenderView at (0,0) size 396x600
+        layer at (0,0) size 396x600
+          RenderBlock {HTML} at (0,0) size 396x600
+            RenderBody {BODY} at (8,8) size 380x584 [bgcolor=#008000]
diff --git a/LayoutTests/fast/frames/frame-set-scaling-hit.html b/LayoutTests/fast/frames/frame-set-scaling-hit.html
new file mode 100644 (file)
index 0000000..33bceab
--- /dev/null
@@ -0,0 +1,24 @@
+<html>
+  <head>
+    <title>Frame Scale Hit Test</title>
+
+    <script>
+        function init() {
+            if (!window.eventSender)
+                return;
+            // Scale the page and resize the frames to verify hit testing on the frameset
+            var leftPanelWidth = window.innerWidth / 8;
+            eventSender.scalePageBy(0.5, 0, 0);
+            eventSender.mouseMoveTo(leftPanelWidth, window.innerHeight / 4);
+            eventSender.mouseDown();
+            eventSender.mouseMoveTo(2 * leftPanelWidth, window.innerHeight / 4);
+            eventSender.mouseUp();
+        }
+        window.onload = init;
+    </script>
+  </head>
+  <frameset style="background-color: red; -webkit-transform-origin: 0% 0%;" cols="25%,75%">
+    <frame src="data:text/html,<body bgcolor='green'></body>">
+    <frame src="data:text/html,<body bgcolor='green'></body>">
+  </frameset>
+</html>
index e7f8019095cc65d2ded068d53272757e733bd5d3..72897a9d3c06545633bae9bce7bd946ebeca8ee7 100644 (file)
@@ -1,3 +1,16 @@
+2011-09-29  Fady Samuel  <fsamuel@chromium.org>
+
+        Fixed Hit testing on Framesets when Frameset is transformed
+        https://bugs.webkit.org/show_bug.cgi?id=67740
+
+        Reviewed by Simon Fraser.
+
+        Tests: fast/frames/frame-set-rotation-hit.html
+               fast/frames/frame-set-scaling-hit.html
+
+        * rendering/RenderFrameSet.cpp:
+        (WebCore::RenderFrameSet::userResize):
+
 2011-09-29  Dirk Pranke  <dpranke@chromium.org>
 
         fix gyp warnings in chromium for renamed files
index 01c1af5d69699527e5255f8eac9a187a2a5b17b8..ee0e7bb34626f2fba72371f2266d4265a4b3c377 100644 (file)
@@ -699,9 +699,9 @@ bool RenderFrameSet::userResize(MouseEvent* evt)
         if (needsLayout())
             return false;
         if (evt->type() == eventNames().mousedownEvent && evt->button() == LeftButton) {
-            FloatPoint pos = localToAbsolute();
-            startResizing(m_cols, evt->absoluteLocation().x() - pos.x());
-            startResizing(m_rows, evt->absoluteLocation().y() - pos.y());
+            FloatPoint localPos = absoluteToLocal(evt->absoluteLocation(), false, true);
+            startResizing(m_cols, localPos.x());
+            startResizing(m_rows, localPos.y());
             if (m_cols.m_splitBeingResized != noSplit || m_rows.m_splitBeingResized != noSplit) {
                 setIsResizing(true);
                 return true;
@@ -709,9 +709,9 @@ bool RenderFrameSet::userResize(MouseEvent* evt)
         }
     } else {
         if (evt->type() == eventNames().mousemoveEvent || (evt->type() == eventNames().mouseupEvent && evt->button() == LeftButton)) {
-            FloatPoint pos = localToAbsolute();
-            continueResizing(m_cols, evt->absoluteLocation().x() - pos.x());
-            continueResizing(m_rows, evt->absoluteLocation().y() - pos.y());
+            FloatPoint localPos = absoluteToLocal(evt->absoluteLocation(), false, true);
+            continueResizing(m_cols, localPos.x());
+            continueResizing(m_rows, localPos.y());
             if (evt->type() == eventNames().mouseupEvent && evt->button() == LeftButton) {
                 setIsResizing(false);
                 return true;