Massive 3d transforms aren't displayed

RESOLVED FIXED in mozilla30

Status

()

P4
normal
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: mattwoodrow, Unassigned)

Tracking

({css-moz, css3})

Trunk
mozilla30
css-moz, css3
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Reporter)

Description

5 years ago
Created attachment 8375989 [details]
Archive.zip

+++ This bug was initially created as a clone of Bug #952011 +++

Testcase attached.

When we 3d transform an element to be 'massive', such that it overflows the max nscoord value in both directions, it is no longer displayed.

The issue is when converting the transformed size from float pixels into app units (done for both the display item bounds, and frame overflow computation).

We clamp the values to nscoord_MIN/MAX giving us:

(nsRect) $65 = {
  mozilla::gfx::BaseRect<int, nsRect, nsPoint, nsSize, nsMargin> = {
    x = -1073741824
    y = -1073741824
    width = 1073741824
    height = 1073741824
  }
}

This rect doesn't intersect the viewport, so the item fails visibility computation and is hidden.
(Reporter)

Updated

5 years ago
Attachment #8375989 - Attachment is patch: false
Attachment #8375989 - Attachment mime type: text/plain → application/zip
(Reporter)

Comment 1

5 years ago
Created attachment 8376018 [details] [diff] [review]
transforms-fix
Attachment #8376018 - Flags: review?(roc)
Comment on attachment 8376018 [details] [diff] [review]
transforms-fix

Review of attachment 8376018 [details] [diff] [review]:
-----------------------------------------------------------------

::: layout/base/nsLayoutUtils.cpp
@@ +1647,5 @@
> +  }
> +
> +  if (aStart <= nscoord_MIN) {
> +    if (aSize == nscoord_MAX) {
> +      aStart = nscoord_MIN/2;

This discontinuity seems a bit dodgy... what if aSize == nscoord_MAX - 1?

How about we explicitly compute x/xmost, clamp those to nscoord_MIN/2 and nscoord_MAX/2, and then convert back to start/length.
Attachment #8376018 - Flags: review?(roc) → review-
(Reporter)

Comment 3

5 years ago
Created attachment 8376867 [details] [diff] [review]
transforms-fix v2

Yeah, you're right. I think this one makes more sense :)
Attachment #8376867 - Flags: review?(roc)
(Reporter)

Updated

5 years ago
Attachment #8376018 - Attachment is obsolete: true
* along with bug 889959
https://hg.mozilla.org/mozilla-central/rev/c2e9792b72d4
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
You need to log in before you can comment on or make changes to this bug.