Bug 46485 - Generalize from RenderBox to RenderBoxModelObject for getTransformFromContainer
Summary: Generalize from RenderBox to RenderBoxModelObject for getTransformFromContainer
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Minor
Assignee: Abhishek Arya
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-24 10:52 PDT by Abhishek Arya
Modified: 2010-09-24 11:22 PDT (History)
1 user (show)

See Also:


Attachments
Patch (1.70 KB, patch)
2010-09-24 11:14 PDT, Abhishek Arya
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Abhishek Arya 2010-09-24 10:52:18 PDT
Fixing as per Simon's comments:
   Comment #5 From  Simon Fraser (smfr)   2010-09-24 10:38:50 PST  (-) [reply]

I think a better fix would be:


diff --git a/WebCore/rendering/RenderObject.cpp b/WebCore/rendering/RenderObject.cpp
index 39ee309..346cd8b 100644
--- a/WebCore/rendering/RenderObject.cpp
+++ b/WebCore/rendering/RenderObject.cpp
@@ -1988,10 +1988,10 @@ void RenderObject::getTransformFromContainer(const RenderObject* containerObject
         transform.multLeft(layer->currentTransform());

 #if ENABLE(3D_RENDERING)
-    if (containerObject && containerObject->isBox() && containerObject->hasLayer() && containerObject->style()->hasPerspective()) {
+    if (containerObject && 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();
+        FloatPoint perspectiveOrigin = toRenderBoxModelObject(containerObject)->layer()->perspectiveOrigin();

         TransformationMatrix perspectiveMatrix;
         perspectiveMatrix.applyPerspective(containerObject->style()->perspective());


Nowhere do we state that something has to be a box to have perspective.
Comment 1 Abhishek Arya 2010-09-24 10:52:49 PDT
This fix is so as to comply with the spec, although the current code does not work on things other than RenderBox.
Comment 2 Abhishek Arya 2010-09-24 11:14:39 PDT
Created attachment 68716 [details]
Patch
Comment 3 Abhishek Arya 2010-09-24 11:22:21 PDT
Committed r68278: <http://trac.webkit.org/changeset/68278>