Last Comment Bug 704469 - overflow: hidden, auto, or scroll removes css3-3d-transforms 'perspective'
: overflow: hidden, auto, or scroll removes css3-3d-transforms 'perspective'
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Layout (show other bugs)
: 10 Branch
: All All
: P2 normal (vote)
: mozilla12
Assigned To: Matt Woodrow (:mattwoodrow) (PTO until 27 June)
:
Mentors:
Depends on: 723643 747664
Blocks: 505115
  Show dependency treegraph
 
Reported: 2011-11-22 06:31 PST by Dirk
Modified: 2013-08-02 10:00 PDT (History)
7 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
index.html (1.58 KB, text/html)
2011-11-22 06:31 PST, Dirk
no flags Details
Check style parent, instead of frame parent (3.41 KB, patch)
2012-01-03 13:33 PST, Matt Woodrow (:mattwoodrow) (PTO until 27 June)
roc: review+
jpr: approval‑mozilla‑aurora+
jpr: approval‑mozilla‑beta+
Details | Diff | Review

Description Dirk 2011-11-22 06:31:23 PST
Created attachment 576140 [details]
index.html

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.51.22 (KHTML, like Gecko) Version/5.1.1 Safari/534.51.22

Steps to reproduce:

Apply CSS3 3D "-moz-perspective" and "overflow: hidden" to block level element




Actual results:

Child elements are rendered as if parent would not have a "perspective" attribute.


Expected results:

Perspective distortion should be applied to child elements. See Demo at http://www.eleqtriq.com/wp-content/static/demos/2011/mozbugs/
Comment 1 David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) 2011-12-26 13:39:14 PST
This seems likely to be related to the fact that overflow:hidden creates two frames, one nested inside the other (the inner one having an anonymous box style).

I think the problem here is that nsDisplayTransform::GetResultingTransformMatrix (in layout/base/nsDisplayList.cpp) should replace:

2539   const nsStyleDisplay* parentDisp = nsnull;
2540   if (aFrame->GetParent()) {
2541     parentDisp = aFrame->GetParent()->GetStyleDisplay();
2542   }

with:

const nsStyleDisplay *parentDisp = nsnull;
nsStyleContext *parentStyleContext = aFrame->GetStyleContext()->GetParent();
if (parentStyleContext) {
  parentDisp = parentStyleContext->GetStyleDisplay();
}

so that it gets the perspective from the style parent.
Comment 2 David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) 2011-12-29 09:54:43 PST
I think it would be good to get this fixed for Firefox 10 (where, if my memory is correct, 3-D transforms are a new feature).
Comment 3 Matt Woodrow (:mattwoodrow) (PTO until 27 June) 2012-01-03 13:33:30 PST
Created attachment 585545 [details] [diff] [review]
Check style parent, instead of frame parent

Thanks for looking into this dbaron

Requesting aurora/beta approval since this fixes a bug with our implementation of 3d transforms. Should be very low risk, and well covered by tests.
Comment 4 Alex Keybl [:akeybl] 2012-01-03 14:57:40 PST
Comment on attachment 585545 [details] [diff] [review]
Check style parent, instead of frame parent

[Triage Comment]
Please re-nominate once this has landed on m-c and gotten some bake time.
Comment 5 Matt Woodrow (:mattwoodrow) (PTO until 27 June) 2012-01-03 16:40:16 PST
https://hg.mozilla.org/integration/mozilla-inbound/rev/7d6b4a1557f4
Comment 6 Marco Bonardo [::mak] 2012-01-04 04:50:22 PST
https://hg.mozilla.org/mozilla-central/rev/7d6b4a1557f4
Comment 7 David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) 2012-01-10 11:15:30 PST
Comment on attachment 585545 [details] [diff] [review]
Check style parent, instead of frame parent

renominating per comment 4

Note You need to log in before you can comment on or make changes to this bug.