W3C home > Mailing lists > Public > www-style@w3.org > November 2015

[css-transforms] How should overflow be calculated for perspective transforms?

From: Matt Woodrow <mwoodrow@mozilla.com>
Date: Tue, 10 Nov 2015 15:23:13 +1300
To: "www-style@w3.org" <www-style@w3.org>
Message-ID: <56415511.5090604@mozilla.com>
Take the following example: 

In Firefox, you can scroll well beyond the end of the content. This is 
because we're computing the overflow area of the elements (with 
perspective transforms included) as they exist at scrollTop == 0. This 
doesn't take into account that the perspective transform is dependent on 
scroll position, and the 'real' overflow area actually shrinks as you 

In both Safari and Chrome you can't scroll the entire orange element 
into view. This appears to be because overflow is being computed without 
the perspective transforms applied, and perspective is just a rendering 
effect. Commenting out the perspective rule from the css helps show this.

The Transforms spec says:

 > Therefore, if the value of the overflow property is scroll or auto, 
scrollbars will appear as needed to see content that is transformed 
outside the visible area.

Should the spec be updated to reflect what Safari/Chrome are 
implementing? Or should it remain as is (probably with some 
clarification), and the browser behaviour be fixed?

The latter seems to make more sense to me (why single out perspective as 
not contributing to overflow?), though it is admittedly considerably 
harder to implement. I'm not sure how this change would affect web-compat.

David Baron and I have drafted a plan for fixing this in Firefox [1], if 
we decide to go that route.


- Matt

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1198135
Received on Tuesday, 10 November 2015 02:23:48 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:58 UTC