resize property doesn't work on iframes
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Jan 2013 00:44:18 +0000 (00:44 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Jan 2013 00:44:18 +0000 (00:44 +0000)
https://bugs.webkit.org/show_bug.cgi?id=9221

Patch by Christian Biesinger <cbiesinger@chromium.org> on 2013-01-24
Reviewed by Eric Seidel.

Source/WebCore:

Test: fast/css/resize-corner-tracking-transformed-iframe.html
and fast/css/resize-corner-tracking.html

* rendering/RenderIFrame.cpp:
(WebCore::RenderIFrame::requiresLayer):
(WebCore):
* rendering/RenderIFrame.h:
<iframe>s need a layer to be resizable, so make requiresLayer return
true if the css property is set.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::canResize):
(WebCore):
(WebCore::RenderLayer::resize):
(WebCore::RenderLayer::positionOverflowControls):
(WebCore::RenderLayer::isPointInResizeControl):
(WebCore::RenderLayer::hitTestOverflowControls):
(WebCore::RenderLayer::hitTestLayer):
* rendering/RenderLayer.h:
(RenderLayer):
Add a new canResize() function and use it instead of hasOverflowClip()
to check whether resizing should be allowed (there's still the
additional check of style()->resize() != RESIZE_NONE, of course)

Make hitTestLayer return |this| when the point is inside the
resizer rectangle.

* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::paint):
Call layer()->paintResizer() to actually paint the resizer.

LayoutTests:

* fast/css/resize-corner-tracking-transformed-iframe.html: Added.
New test for testing resize of transformed <iframe>

* fast/css/resize-corner-tracking.html:
Add a testcase for resizing an <iframe>

* platform/chromium-linux/fast/css/resize-corner-tracking-expected.png:
* platform/chromium-linux/fast/css/resize-corner-tracking-transformed-iframe-expected.png: Added.
* platform/chromium-mac/fast/css/resize-corner-tracking-transformed-iframe-expected.png: Added.
* platform/chromium-win/fast/css/resize-corner-tracking-expected.txt:
* platform/chromium/compositing/iframes/resizer-expected.txt:
* platform/chromium/fast/css/resize-corner-tracking-expected.txt:
* platform/chromium/fast/css/resize-corner-tracking-transformed-expected.txt:
* platform/chromium/fast/css/resize-corner-tracking-transformed-iframe-expected.txt: Added.
* platform/mac/fast/css/resize-corner-tracking-expected.txt:
* platform/mac/fast/css/resize-corner-tracking-transformed-iframe-expected.png: Added.
* platform/mac/fast/css/resize-corner-tracking-transformed-iframe-expected.txt: Added.
Update/add generic, mac and linux reference files for the test

* platform/chromium/TestExpectations:
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/qt/TestExpectations:
* platform/win/TestExpectations:
Add expected failures for the tests until they can be rebaselined.

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

25 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/resize-corner-tracking-transformed-iframe.html [new file with mode: 0644]
LayoutTests/fast/css/resize-corner-tracking.html
LayoutTests/platform/chromium-linux/fast/css/resize-corner-tracking-expected.png
LayoutTests/platform/chromium-linux/fast/css/resize-corner-tracking-transformed-iframe-expected.png [new file with mode: 0644]
LayoutTests/platform/chromium-mac/fast/css/resize-corner-tracking-transformed-iframe-expected.png [new file with mode: 0644]
LayoutTests/platform/chromium-win/fast/css/resize-corner-tracking-expected.txt
LayoutTests/platform/chromium/TestExpectations
LayoutTests/platform/chromium/compositing/iframes/resizer-expected.txt
LayoutTests/platform/chromium/fast/css/resize-corner-tracking-expected.txt
LayoutTests/platform/chromium/fast/css/resize-corner-tracking-transformed-expected.txt
LayoutTests/platform/chromium/fast/css/resize-corner-tracking-transformed-iframe-expected.txt [new file with mode: 0644]
LayoutTests/platform/efl/TestExpectations
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/mac/fast/css/resize-corner-tracking-expected.txt
LayoutTests/platform/mac/fast/css/resize-corner-tracking-transformed-iframe-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/css/resize-corner-tracking-transformed-iframe-expected.txt [new file with mode: 0644]
LayoutTests/platform/qt/TestExpectations
LayoutTests/platform/win/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderIFrame.cpp
Source/WebCore/rendering/RenderIFrame.h
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderWidget.cpp

index 03f511c..47d4a52 100644 (file)
@@ -1,3 +1,36 @@
+2013-01-24  Christian Biesinger  <cbiesinger@chromium.org>
+
+        resize property doesn't work on iframes
+        https://bugs.webkit.org/show_bug.cgi?id=9221
+
+        Reviewed by Eric Seidel.
+
+        * fast/css/resize-corner-tracking-transformed-iframe.html: Added.
+        New test for testing resize of transformed <iframe>
+
+        * fast/css/resize-corner-tracking.html:
+        Add a testcase for resizing an <iframe>
+
+        * platform/chromium-linux/fast/css/resize-corner-tracking-expected.png:
+        * platform/chromium-linux/fast/css/resize-corner-tracking-transformed-iframe-expected.png: Added.
+        * platform/chromium-mac/fast/css/resize-corner-tracking-transformed-iframe-expected.png: Added.
+        * platform/chromium-win/fast/css/resize-corner-tracking-expected.txt:
+        * platform/chromium/compositing/iframes/resizer-expected.txt:
+        * platform/chromium/fast/css/resize-corner-tracking-expected.txt:
+        * platform/chromium/fast/css/resize-corner-tracking-transformed-expected.txt:
+        * platform/chromium/fast/css/resize-corner-tracking-transformed-iframe-expected.txt: Added.
+        * platform/mac/fast/css/resize-corner-tracking-expected.txt:
+        * platform/mac/fast/css/resize-corner-tracking-transformed-iframe-expected.png: Added.
+        * platform/mac/fast/css/resize-corner-tracking-transformed-iframe-expected.txt: Added.
+        Update/add generic, mac and linux reference files for the test
+
+        * platform/chromium/TestExpectations:
+        * platform/efl/TestExpectations:
+        * platform/gtk/TestExpectations:
+        * platform/qt/TestExpectations:
+        * platform/win/TestExpectations:
+        Add expected failures for the tests until they can be rebaselined.
+
 2013-01-24  Kentaro Hara  <haraken@chromium.org>
 
         Regression(r107058): Use-after-free in SerializedScriptValue::deserialize
diff --git a/LayoutTests/fast/css/resize-corner-tracking-transformed-iframe.html b/LayoutTests/fast/css/resize-corner-tracking-transformed-iframe.html
new file mode 100644 (file)
index 0000000..498d28b
--- /dev/null
@@ -0,0 +1,37 @@
+<html>
+<head>
+    <title>Transformed resize corner tracking</title>
+    <script type="text/javascript">
+        function resize()
+        {
+            eventSender.mouseMoveTo(185, 233);
+            eventSender.mouseDown();
+            eventSender.mouseMoveTo(185, 260);
+            eventSender.mouseUp();
+        }
+        function test()
+        {
+            if (!window.testRunner)
+                return;
+
+            resize();
+        }
+    </script>
+    <style>
+      iframe {
+        -webkit-transform: rotate(20deg);
+        margin: 50px;
+      }
+    </style>
+</head>
+<body onload="test()">
+    <hr>
+    <p>
+        Test for
+        <i><a href="https://bugs.webkit.org/show_bug.cgi?id=9221">https://bugs.webkit.org/show_bug.cgi?id=9221</a>
+        resize property doesn't work on iframes</i>.
+    </p>
+    <hr>
+    <iframe id="iframe" style="resize: both; width: 150px; height: 100px; border: blue 2px solid;"></iframe>
+
+</body>
index bc16fcd..749150f 100644 (file)
@@ -19,6 +19,7 @@
             resize("div");
             resize("textarea1");
             resize("textarea2");
+            resize("iframe1");
         }
     </script>
 <style>
@@ -39,4 +40,6 @@ textarea {
     <textarea id="textarea1" style="width: 150px; height: 100px; border: blue 2px solid;"></textarea>
     <br>
     <textarea id="textarea2"></textarea>
+    <br>
+    <iframe id="iframe1" style="resize:both;"></iframe>
 </body>
index ce4cbbe..cdb9356 100644 (file)
Binary files a/LayoutTests/platform/chromium-linux/fast/css/resize-corner-tracking-expected.png and b/LayoutTests/platform/chromium-linux/fast/css/resize-corner-tracking-expected.png differ
diff --git a/LayoutTests/platform/chromium-linux/fast/css/resize-corner-tracking-transformed-iframe-expected.png b/LayoutTests/platform/chromium-linux/fast/css/resize-corner-tracking-transformed-iframe-expected.png
new file mode 100644 (file)
index 0000000..3051cb1
Binary files /dev/null and b/LayoutTests/platform/chromium-linux/fast/css/resize-corner-tracking-transformed-iframe-expected.png differ
diff --git a/LayoutTests/platform/chromium-mac/fast/css/resize-corner-tracking-transformed-iframe-expected.png b/LayoutTests/platform/chromium-mac/fast/css/resize-corner-tracking-transformed-iframe-expected.png
new file mode 100644 (file)
index 0000000..1192c3a
Binary files /dev/null and b/LayoutTests/platform/chromium-mac/fast/css/resize-corner-tracking-transformed-iframe-expected.png differ
index 67621e2..c1bac61 100644 (file)
@@ -17,10 +17,13 @@ layer at (0,0) size 800x600
         RenderText {#text} at (726,0) size 4x19
           text run at (726,0) width 4: "."
       RenderBlock {HR} at (0,54) size 784x2 [border: (1px inset #000000)]
-      RenderBlock (anonymous) at (0,189) size 784x187
+      RenderBlock (anonymous) at (0,189) size 784x367
         RenderText {#text} at (169,106) size 4x19
           text run at (169,106) width 4: " "
         RenderBR {BR} at (0,0) size 0x0
+        RenderText {#text} at (202,172) size 4x19
+          text run at (202,172) width 4: " "
+        RenderBR {BR} at (0,0) size 0x0
         RenderText {#text} at (0,0) size 0x0
 layer at (8,72) size 173x125 clip at (10,74) size 169x121
   RenderBlock {DIV} at (0,64) size 173x125 [border: (2px solid #0000FF)]
@@ -30,3 +33,10 @@ layer at (8,197) size 169x121 clip at (10,199) size 165x117
 layer at (10,325) size 198x57 clip at (11,326) size 196x55
   RenderTextControl {TEXTAREA} at (2,128) size 198x57 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
     RenderBlock {DIV} at (3,3) size 194x16
+layer at (8,389) size 323x175
+  RenderPartObject {IFRAME} at (0,192) size 323x175 [border: (2px inset #000000)]
+    layer at (0,0) size 319x171
+      RenderView at (0,0) size 319x171
+    layer at (0,0) size 319x171
+      RenderBlock {HTML} at (0,0) size 319x171
+        RenderBody {BODY} at (8,8) size 303x155
index 57ac218..6822014 100644 (file)
@@ -4668,3 +4668,7 @@ webkit.org/b/107567 css2.1/t0505-c16-descendant-01-e.html [ Failure ]
 webkit.org/b/107567 tables/mozilla/bugs/bug1188.html [ Failure ] 
 webkit.org/b/107567 editing/selection/extend-by-sentence-001.html [ Failure ] 
 webkit.org/b/107567 svg/carto.net/combobox.svg [ Failure ] 
+
+# Needs rebaseline after https://bugs.webkit.org/show_bug.cgi?id=9221
+webkit.org/b/9221 [ Win ] fast/css/resize-corner-tracking.html [ Failure ]
+webkit.org/b/9221 [ Win ] fast/css/resize-corner-tracking-transformed-iframe.html [ Missing ]
index b839bb9..1b20fa6 100644 (file)
@@ -46,6 +46,9 @@
               )
             )
             (GraphicsLayer
+              (position 287.00 137.00)
+              (bounds 15.00 15.00)
+              (drawsContent 1)
             )
           )
         )
index 02ed7db..c1bac61 100644 (file)
@@ -4,29 +4,39 @@ layer at (0,0) size 800x600
   RenderBlock {HTML} at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 784x584
       RenderBlock {HR} at (0,0) size 784x2 [border: (1px inset #000000)]
-      RenderBlock {P} at (0,18) size 784x18
-        RenderText {#text} at (0,0) size 53x18
-          text run at (0,0) width 53: "Test for "
-        RenderInline {I} at (0,0) size 669x18
-          RenderInline {A} at (0,0) size 348x18 [color=#0000EE]
-            RenderText {#text} at (53,0) size 348x18
-              text run at (53,0) width 348: "http://bugzilla.opendarwin.org/show_bug.cgi?id=9547"
-          RenderText {#text} at (401,0) size 321x18
+      RenderBlock {P} at (0,18) size 784x20
+        RenderText {#text} at (0,0) size 51x19
+          text run at (0,0) width 51: "Test for "
+        RenderInline {I} at (0,0) size 675x19
+          RenderInline {A} at (0,0) size 350x19 [color=#0000EE]
+            RenderText {#text} at (51,0) size 350x19
+              text run at (51,0) width 350: "http://bugzilla.opendarwin.org/show_bug.cgi?id=9547"
+          RenderText {#text} at (401,0) size 325x19
             text run at (401,0) width 4: " "
-            text run at (405,0) width 317: "Resize corner does not track the mouse accurately"
-        RenderText {#text} at (722,0) size 4x18
-          text run at (722,0) width 4: "."
-      RenderBlock {HR} at (0,52) size 784x2 [border: (1px inset #000000)]
-      RenderBlock (anonymous) at (0,187) size 784x182
-        RenderText {#text} at (169,107) size 4x18
-          text run at (169,107) width 4: " "
+            text run at (405,0) width 321: "Resize corner does not track the mouse accurately"
+        RenderText {#text} at (726,0) size 4x19
+          text run at (726,0) width 4: "."
+      RenderBlock {HR} at (0,54) size 784x2 [border: (1px inset #000000)]
+      RenderBlock (anonymous) at (0,189) size 784x367
+        RenderText {#text} at (169,106) size 4x19
+          text run at (169,106) width 4: " "
+        RenderBR {BR} at (0,0) size 0x0
+        RenderText {#text} at (202,172) size 4x19
+          text run at (202,172) width 4: " "
         RenderBR {BR} at (0,0) size 0x0
         RenderText {#text} at (0,0) size 0x0
-layer at (8,70) size 173x125 clip at (10,72) size 169x121
-  RenderBlock {DIV} at (0,62) size 173x125 [border: (2px solid #0000FF)]
-layer at (8,195) size 169x121 clip at (10,197) size 165x117
+layer at (8,72) size 173x125 clip at (10,74) size 169x121
+  RenderBlock {DIV} at (0,64) size 173x125 [border: (2px solid #0000FF)]
+layer at (8,197) size 169x121 clip at (10,199) size 165x117
   RenderTextControl {TEXTAREA} at (0,0) size 169x121 [bgcolor=#FFFFFF] [border: (2px solid #0000FF)]
-    RenderBlock {DIV} at (4,4) size 161x13
-layer at (10,322) size 180x53 clip at (11,323) size 178x51
-  RenderTextControl {TEXTAREA} at (2,127) size 180x53 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
-    RenderBlock {DIV} at (3,3) size 174x13
+    RenderBlock {DIV} at (4,4) size 163x16
+layer at (10,325) size 198x57 clip at (11,326) size 196x55
+  RenderTextControl {TEXTAREA} at (2,128) size 198x57 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
+    RenderBlock {DIV} at (3,3) size 194x16
+layer at (8,389) size 323x175
+  RenderPartObject {IFRAME} at (0,192) size 323x175 [border: (2px inset #000000)]
+    layer at (0,0) size 319x171
+      RenderView at (0,0) size 319x171
+    layer at (0,0) size 319x171
+      RenderBlock {HTML} at (0,0) size 319x171
+        RenderBody {BODY} at (8,8) size 303x155
index 08e62b5..810c2f7 100644 (file)
@@ -4,18 +4,18 @@ layer at (0,0) size 800x600
   RenderBlock {HTML} at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 784x542
       RenderBlock {HR} at (0,0) size 784x2 [border: (1px inset #000000)]
-      RenderBlock {P} at (0,18) size 784x18
-        RenderText {#text} at (0,0) size 53x18
-          text run at (0,0) width 53: "Test for "
-        RenderInline {I} at (0,0) size 646x18
-          RenderInline {A} at (0,0) size 307x18 [color=#0000EE]
-            RenderText {#text} at (53,0) size 307x18
-              text run at (53,0) width 307: "https://bugs.webkit.org/show_bug.cgi?id=22118"
-          RenderText {#text} at (360,0) size 339x18
-            text run at (360,0) width 4: " "
-            text run at (364,0) width 335: "Resize corner does not track in transformed elements"
-        RenderText {#text} at (699,0) size 4x18
-          text run at (699,0) width 4: "."
-      RenderBlock {HR} at (0,52) size 784x2 [border: (1px inset #000000)]
-layer at (58,112) size 163x129 clip at (60,114) size 159x125
-  RenderBlock {DIV} at (50,104) size 163x129 [border: (2px solid #0000FF)]
+      RenderBlock {P} at (0,18) size 784x20
+        RenderText {#text} at (0,0) size 51x19
+          text run at (0,0) width 51: "Test for "
+        RenderInline {I} at (0,0) size 655x19
+          RenderInline {A} at (0,0) size 311x19 [color=#0000EE]
+            RenderText {#text} at (51,0) size 311x19
+              text run at (51,0) width 311: "https://bugs.webkit.org/show_bug.cgi?id=22118"
+          RenderText {#text} at (362,0) size 344x19
+            text run at (362,0) width 4: " "
+            text run at (366,0) width 340: "Resize corner does not track in transformed elements"
+        RenderText {#text} at (706,0) size 4x19
+          text run at (706,0) width 4: "."
+      RenderBlock {HR} at (0,54) size 784x2 [border: (1px inset #000000)]
+layer at (58,114) size 163x129 clip at (60,116) size 159x125
+  RenderBlock {DIV} at (50,106) size 163x129 [border: (2px solid #0000FF)]
diff --git a/LayoutTests/platform/chromium/fast/css/resize-corner-tracking-transformed-iframe-expected.txt b/LayoutTests/platform/chromium/fast/css/resize-corner-tracking-transformed-iframe-expected.txt
new file mode 100644 (file)
index 0000000..ff2e441
--- /dev/null
@@ -0,0 +1,28 @@
+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 784x584
+      RenderBlock {HR} at (0,0) size 784x2 [border: (1px inset #000000)]
+      RenderBlock {P} at (0,18) size 784x20
+        RenderText {#text} at (0,0) size 51x19
+          text run at (0,0) width 51: "Test for "
+        RenderInline {I} at (0,0) size 560x19
+          RenderInline {A} at (0,0) size 303x19 [color=#0000EE]
+            RenderText {#text} at (51,0) size 303x19
+              text run at (51,0) width 303: "https://bugs.webkit.org/show_bug.cgi?id=9221"
+          RenderText {#text} at (354,0) size 257x19
+            text run at (354,0) width 4: " "
+            text run at (358,0) width 253: "resize property doesn't work on iframes"
+        RenderText {#text} at (611,0) size 4x19
+          text run at (611,0) width 4: "."
+      RenderBlock {HR} at (0,54) size 784x2 [border: (1px inset #000000)]
+      RenderBlock (anonymous) at (0,64) size 784x230
+        RenderText {#text} at (0,0) size 0x0
+layer at (58,122) size 163x130
+  RenderPartObject {IFRAME} at (50,50) size 163x130 [border: (2px solid #0000FF)]
+    layer at (0,0) size 159x126
+      RenderView at (0,0) size 159x126
+    layer at (0,0) size 159x126
+      RenderBlock {HTML} at (0,0) size 159x126
+        RenderBody {BODY} at (8,8) size 143x110
index 8c0effb..e50f850 100644 (file)
@@ -1258,6 +1258,7 @@ webkit.org/b/49142 fast/css/style-scoped [ Skip ]
 webkit.org/b/78801 touchadjustment
 
 # Tracking corner not being painted for TextArea.
+webkit.org/b/9221 fast/css/resize-corner-tracking-transformed-iframe.html [ Missing ]
 webkit.org/b/85484 fast/css/resize-corner-tracking-transformed.html [ Failure ]
 webkit.org/b/85484 fast/css/resize-corner-tracking.html [ Failure ]
 
index 864f205..3381fb1 100644 (file)
@@ -53,6 +53,10 @@ webkit.org/b/105639 fast/inline/justify-emphasis-inline-box.html [ Missing ]
 
 webkit.org/b/103955 fast/repaint/caret-with-transformation.html [ Missing ]
 
+# Needs rebaseline after https://bugs.webkit.org/show_bug.cgi?id=9221
+webkit.org/b/9221 fast/css/resize-corner-tracking.html [ Failure ]
+webkit.org/b/9221 fast/css/resize-corner-tracking-transformed-iframe.html [ Missing ]
+
 # Needs rebaseline after https://bugs.webkit.org/show_bug.cgi?id=14664
 webkit.org/b/107476 fast/block/float/024.html [ Failure ]
 webkit.org/b/107476 fast/block/margin-collapse/empty-clear-blocks.html [ Failure ]
index 02ed7db..2729bb0 100644 (file)
@@ -17,10 +17,13 @@ layer at (0,0) size 800x600
         RenderText {#text} at (722,0) size 4x18
           text run at (722,0) width 4: "."
       RenderBlock {HR} at (0,52) size 784x2 [border: (1px inset #000000)]
-      RenderBlock (anonymous) at (0,187) size 784x182
+      RenderBlock (anonymous) at (0,187) size 784x361
         RenderText {#text} at (169,107) size 4x18
           text run at (169,107) width 4: " "
         RenderBR {BR} at (0,0) size 0x0
+        RenderText {#text} at (184,168) size 4x18
+          text run at (184,168) width 4: " "
+        RenderBR {BR} at (0,0) size 0x0
         RenderText {#text} at (0,0) size 0x0
 layer at (8,70) size 173x125 clip at (10,72) size 169x121
   RenderBlock {DIV} at (0,62) size 173x125 [border: (2px solid #0000FF)]
@@ -30,3 +33,10 @@ layer at (8,195) size 169x121 clip at (10,197) size 165x117
 layer at (10,322) size 180x53 clip at (11,323) size 178x51
   RenderTextControl {TEXTAREA} at (2,127) size 180x53 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
     RenderBlock {DIV} at (3,3) size 174x13
+layer at (8,381) size 323x175
+  RenderPartObject {IFRAME} at (0,186) size 323x175 [border: (2px inset #000000)]
+    layer at (0,0) size 319x171
+      RenderView at (0,0) size 319x171
+    layer at (0,0) size 319x171
+      RenderBlock {HTML} at (0,0) size 319x171
+        RenderBody {BODY} at (8,8) size 303x155
diff --git a/LayoutTests/platform/mac/fast/css/resize-corner-tracking-transformed-iframe-expected.png b/LayoutTests/platform/mac/fast/css/resize-corner-tracking-transformed-iframe-expected.png
new file mode 100644 (file)
index 0000000..d576103
Binary files /dev/null and b/LayoutTests/platform/mac/fast/css/resize-corner-tracking-transformed-iframe-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/css/resize-corner-tracking-transformed-iframe-expected.txt b/LayoutTests/platform/mac/fast/css/resize-corner-tracking-transformed-iframe-expected.txt
new file mode 100644 (file)
index 0000000..a7954c9
--- /dev/null
@@ -0,0 +1,28 @@
+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 784x584
+      RenderBlock {HR} at (0,0) size 784x2 [border: (1px inset #000000)]
+      RenderBlock {P} at (0,18) size 784x18
+        RenderText {#text} at (0,0) size 53x18
+          text run at (0,0) width 53: "Test for "
+        RenderInline {I} at (0,0) size 552x18
+          RenderInline {A} at (0,0) size 299x18 [color=#0000EE]
+            RenderText {#text} at (53,0) size 299x18
+              text run at (53,0) width 299: "https://bugs.webkit.org/show_bug.cgi?id=9221"
+          RenderText {#text} at (352,0) size 253x18
+            text run at (352,0) width 4: " "
+            text run at (356,0) width 249: "resize property doesn't work on iframes"
+        RenderText {#text} at (605,0) size 4x18
+          text run at (605,0) width 4: "."
+      RenderBlock {HR} at (0,52) size 784x2 [border: (1px inset #000000)]
+      RenderBlock (anonymous) at (0,62) size 784x230
+        RenderText {#text} at (0,0) size 0x0
+layer at (58,120) size 163x130
+  RenderPartObject {IFRAME} at (50,50) size 163x130 [border: (2px solid #0000FF)]
+    layer at (0,0) size 159x126
+      RenderView at (0,0) size 159x126
+    layer at (0,0) size 159x126
+      RenderBlock {HTML} at (0,0) size 159x126
+        RenderBody {BODY} at (8,8) size 143x110
index d8fbe7a..549b315 100644 (file)
@@ -1968,7 +1968,8 @@ svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse.
 css2.1/t100801-c548-ln-ht-01-b-ag.html
 css2.1/20110323/inline-non-replaced-height-003.htm
 css2.1/20110323/inline-non-replaced-height-002.htm
-
+fast/css/resize-corner-tracking-transformed-iframe.html
+fast/css/resize-corner-tracking.html
 
 # ============================================================================= #
 # Regressions occured after Qt version update
index ff63a27..4b5ec27 100644 (file)
@@ -2528,3 +2528,7 @@ proximity/no-page-cache.html
 proximity/optional-event-properties.html
 proximity/updates.html
 proximity/window-property.html
+
+# Needs rebaseline after https://bugs.webkit.org/show_bug.cgi?id=9221
+webkit.org/b/9221 fast/css/resize-corner-tracking.html [ Failure ]
+webkit.org/b/9221 fast/css/resize-corner-tracking-transformed-iframe.html [ Missing ]
index 533a392..1c21174 100644 (file)
@@ -1,3 +1,41 @@
+2013-01-24  Christian Biesinger  <cbiesinger@chromium.org>
+
+        resize property doesn't work on iframes
+        https://bugs.webkit.org/show_bug.cgi?id=9221
+
+        Reviewed by Eric Seidel.
+
+        Test: fast/css/resize-corner-tracking-transformed-iframe.html
+        and fast/css/resize-corner-tracking.html
+
+        * rendering/RenderIFrame.cpp:
+        (WebCore::RenderIFrame::requiresLayer):
+        (WebCore):
+        * rendering/RenderIFrame.h:
+        <iframe>s need a layer to be resizable, so make requiresLayer return
+        true if the css property is set.
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::canResize):
+        (WebCore):
+        (WebCore::RenderLayer::resize):
+        (WebCore::RenderLayer::positionOverflowControls):
+        (WebCore::RenderLayer::isPointInResizeControl):
+        (WebCore::RenderLayer::hitTestOverflowControls):
+        (WebCore::RenderLayer::hitTestLayer):
+        * rendering/RenderLayer.h:
+        (RenderLayer):
+        Add a new canResize() function and use it instead of hasOverflowClip()
+        to check whether resizing should be allowed (there's still the
+        additional check of style()->resize() != RESIZE_NONE, of course)
+
+        Make hitTestLayer return |this| when the point is inside the
+        resizer rectangle.
+
+        * rendering/RenderWidget.cpp:
+        (WebCore::RenderWidget::paint):
+        Call layer()->paintResizer() to actually paint the resizer.
+
 2013-01-24  Kentaro Hara  <haraken@chromium.org>
 
         Regression(r107058): Use-after-free in SerializedScriptValue::deserialize
index de74a92..6a63368 100644 (file)
@@ -83,6 +83,11 @@ bool RenderIFrame::isSeamless() const
     return node() && node()->hasTagName(iframeTag) && static_cast<HTMLIFrameElement*>(node())->shouldDisplaySeamlessly();
 }
 
+bool RenderIFrame::requiresLayer() const
+{
+    return RenderFrameBase::requiresLayer() || style()->resize() != RESIZE_NONE;
+}
+
 RenderView* RenderIFrame::contentRootRenderer() const
 {
     // FIXME: Is this always a valid cast? What about plugins?
index f0ac3a2..aac0656 100644 (file)
@@ -52,6 +52,8 @@ private:
 
     virtual const char* renderName() const OVERRIDE { return "RenderPartObject"; } // Lying for now to avoid breaking tests
 
+    virtual bool requiresLayer() const OVERRIDE;
+
     void layoutSeamlessly();
 
     RenderView* contentRootRenderer() const;
index 22d5903..4042805 100644 (file)
@@ -2326,20 +2326,26 @@ void RenderLayer::autoscroll(const IntPoint& position)
     scrollRectToVisible(LayoutRect(currentDocumentPosition, LayoutSize(1, 1)), ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded);
 }
 
+bool RenderLayer::canResize() const
+{
+    if (!renderer())
+        return false;
+    // We need a special case for <iframe> because they never have
+    // hasOverflowClip(). However, they do "implicitly" clip their contents, so
+    // we want to allow resizing them also.
+    return (renderer()->hasOverflowClip() || renderer()->isRenderIFrame()) && renderer()->style()->resize() != RESIZE_NONE;
+}
+
 void RenderLayer::resize(const PlatformMouseEvent& evt, const LayoutSize& oldOffset)
 {
     // FIXME: This should be possible on generated content but is not right now.
-    if (!inResizeMode() || !renderer()->hasOverflowClip() || !renderer()->node())
+    if (!inResizeMode() || !canResize() || !renderer()->node())
         return;
 
     ASSERT(renderer()->node()->isElementNode());
     Element* element = static_cast<Element*>(renderer()->node());
     RenderBox* renderer = toRenderBox(element->renderer());
 
-    EResize resize = renderer->style()->resize();
-    if (resize == RESIZE_NONE)
-        return;
-
     Document* document = element->document();
     if (!document->frame()->eventHandler()->mousePressed())
         return;
@@ -2366,6 +2372,7 @@ void RenderLayer::resize(const PlatformMouseEvent& evt, const LayoutSize& oldOff
     StyledElement* styledElement = static_cast<StyledElement*>(element);
     bool isBoxSizingBorder = renderer->style()->boxSizing() == BORDER_BOX;
 
+    EResize resize = renderer->style()->resize();
     if (resize != RESIZE_VERTICAL && difference.width()) {
         if (element->isFormControlElement()) {
             // Make implicit margins from the theme explicit (see <http://bugs.webkit.org/show_bug.cgi?id=9547>).
@@ -2853,7 +2860,7 @@ bool RenderLayer::hasOverflowControls() const
 
 void RenderLayer::positionOverflowControls(const IntSize& offsetFromRoot)
 {
-    if (!m_hBar && !m_vBar && (!renderer()->hasOverflowClip() || renderer()->style()->resize() == RESIZE_NONE))
+    if (!m_hBar && !m_vBar && !canResize())
         return;
     
     RenderBox* box = renderBox();
@@ -3267,7 +3274,7 @@ void RenderLayer::paintResizer(GraphicsContext* context, const IntPoint& paintOf
 
 bool RenderLayer::isPointInResizeControl(const IntPoint& absolutePoint) const
 {
-    if (!renderer()->hasOverflowClip() || renderer()->style()->resize() == RESIZE_NONE)
+    if (!canResize())
         return false;
     
     RenderBox* box = renderBox();
@@ -3278,10 +3285,10 @@ bool RenderLayer::isPointInResizeControl(const IntPoint& absolutePoint) const
     IntRect localBounds(0, 0, box->pixelSnappedWidth(), box->pixelSnappedHeight());
     return resizerCornerRect(this, localBounds).contains(localPoint);
 }
-    
+
 bool RenderLayer::hitTestOverflowControls(HitTestResult& result, const IntPoint& localPoint)
 {
-    if (!m_hBar && !m_vBar && (!renderer()->hasOverflowClip() || renderer()->style()->resize() == RESIZE_NONE))
+    if (!m_hBar && !m_vBar && !canResize())
         return false;
 
     RenderBox* box = renderBox();
@@ -4245,6 +4252,12 @@ RenderLayer* RenderLayer::hitTestLayer(RenderLayer* rootLayer, RenderLayer* cont
         candidateLayer = hitLayer;
     }
 
+    // Check for the resizer
+    if (canResize() && resizerCornerRect(this, pixelSnappedIntRect(layerBounds)).contains(hitTestLocation.roundedPoint())) {
+        renderer()->updateHitTestResult(result, hitTestLocation.point());
+        return this;
+    }
+
     // Next we want to see if the mouse pos is inside the child RenderObjects of the layer.
     if (fgRect.intersects(hitTestLocation) && isSelfPaintingLayer()) {
         // Hit test with a temporary HitTestResult, because we only want to commit to 'result' if we know we're frontmost.
index 3d6eaa1..a5d21d1 100644 (file)
@@ -375,6 +375,7 @@ public:
     bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1);
     void autoscroll(const IntPoint&);
 
+    bool canResize() const;
     void resize(const PlatformMouseEvent&, const LayoutSize&);
     bool inResizeMode() const { return m_inResizeMode; }
     void setInResizeMode(bool b) { m_inResizeMode = b; }
index 77fa5f5..09d5441 100644 (file)
@@ -311,6 +311,9 @@ void RenderWidget::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
         // FIXME: selectionRect() is in absolute, not painting coordinates.
         paintInfo.context->fillRect(pixelSnappedIntRect(selectionRect()), selectionBackgroundColor(), style()->colorSpace());
     }
+
+    if (style()->resize() != RESIZE_NONE)
+        layer()->paintResizer(paintInfo.context, roundedIntPoint(adjustedPaintOffset), paintInfo.rect);
 }
 
 void RenderWidget::setOverlapTestResult(bool isOverlapped)