2010-09-23 Abhishek Arya <inferno@chromium.org>
authorinferno@chromium.org <inferno@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Sep 2010 17:21:07 +0000 (17:21 +0000)
committerinferno@chromium.org <inferno@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Sep 2010 17:21:07 +0000 (17:21 +0000)
        Reviewed by Dave Hyatt.

        Fix the memory safety issue by checking containerObject is a RenderBox
        before doing the transforms.
        https://bugs.webkit.org/show_bug.cgi?id=46365

        Test: compositing/overflow/get-transform-from-non-box-container.html

        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::getTransformFromContainer):
2010-09-23  Abhishek Arya  <inferno@chromium.org>

        Reviewed by Dave Hyatt.

        Tests that we donot assert on object->isBox.
        https://bugs.webkit.org/show_bug.cgi?id=46365

        * compositing/overflow/get-transform-from-non-box-container-expected.txt: Added.
        * compositing/overflow/get-transform-from-non-box-container.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/compositing/overflow/get-transform-from-non-box-container-expected.txt [new file with mode: 0644]
LayoutTests/compositing/overflow/get-transform-from-non-box-container.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/RenderObject.cpp

index d45e5aa..8053e61 100644 (file)
@@ -1,3 +1,13 @@
+2010-09-23  Abhishek Arya  <inferno@chromium.org>
+
+        Reviewed by Dave Hyatt.
+
+        Tests that we donot assert on object->isBox.
+        https://bugs.webkit.org/show_bug.cgi?id=46365
+
+        * compositing/overflow/get-transform-from-non-box-container-expected.txt: Added.
+        * compositing/overflow/get-transform-from-non-box-container.html: Added.
+
 2010-09-23  Dimitri Glazkov  <dglazkov@chromium.org>
 
         Remove passing tests. These were failing because the bot was missing QuickTime.
diff --git a/LayoutTests/compositing/overflow/get-transform-from-non-box-container-expected.txt b/LayoutTests/compositing/overflow/get-transform-from-non-box-container-expected.txt
new file mode 100644 (file)
index 0000000..7ef22e9
--- /dev/null
@@ -0,0 +1 @@
+PASS
diff --git a/LayoutTests/compositing/overflow/get-transform-from-non-box-container.html b/LayoutTests/compositing/overflow/get-transform-from-non-box-container.html
new file mode 100644 (file)
index 0000000..01cc461
--- /dev/null
@@ -0,0 +1,24 @@
+<html>\r
+    <head>\r
+        <style>\r
+            .container {\r
+                display: inline; \r
+                -webkit-perspective: 10px; \r
+            }\r
+            .intermediate {\r
+                -webkit-column-width: 100px;\r
+            }\r
+        </style>\r
+    </head>\r
+    <body>\r
+        <div class="container" style="position: relative">\r
+            <div class="intermediate" style="position: absolute">\r
+                PASS\r
+            </div>\r
+        </div>\r
+        <script>\r
+            if (window.layoutTestController)\r
+                layoutTestController.dumpAsText();\r
+        </script>\r
+    </body>\r
+</html>\r
index 59757c5..3ee4e1c 100644 (file)
@@ -1,3 +1,16 @@
+2010-09-23  Abhishek Arya  <inferno@chromium.org>
+
+        Reviewed by Dave Hyatt.
+
+        Fix the memory safety issue by checking containerObject is a RenderBox
+        before doing the transforms.
+        https://bugs.webkit.org/show_bug.cgi?id=46365
+
+        Test: compositing/overflow/get-transform-from-non-box-container.html
+
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::getTransformFromContainer):
+
 2010-09-23  David Hyatt  <hyatt@apple.com>
 
         Reviewed by Simon Fraser.
index e200ff9..67855cf 100644 (file)
@@ -1988,7 +1988,7 @@ void RenderObject::getTransformFromContainer(const RenderObject* containerObject
         transform.multLeft(layer->currentTransform());
     
 #if ENABLE(3D_RENDERING)
-    if (containerObject && containerObject->hasLayer() && containerObject->style()->hasPerspective()) {
+    if (containerObject && containerObject->isBox() && containerObject->hasLayer() && containerObject->style()->hasPerspective()) {
         // Perpsective on the container affects us, so we have to factor it in here.
         ASSERT(containerObject->hasLayer());
         FloatPoint perspectiveOrigin = toRenderBox(containerObject)->layer()->perspectiveOrigin();