Closed Bug 972703 Opened 6 years ago Closed 6 years ago

Massive 3d transforms aren't displayed

Categories

(Core :: Layout, defect, P4)

defect

Tracking

()

RESOLVED FIXED
mozilla30

People

(Reporter: mattwoodrow, Unassigned)

References

Details

(Keywords: css-moz, css3)

Attachments

(2 files, 1 obsolete file)

Attached file 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.
Attachment #8375989 - Attachment is patch: false
Attachment #8375989 - Attachment mime type: text/plain → application/zip
Attached patch transforms-fix (obsolete) — Splinter Review
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-
Yeah, you're right. I think this one makes more sense :)
Attachment #8376867 - Flags: review?(roc)
Attachment #8376018 - Attachment is obsolete: true
* along with bug 889959
https://hg.mozilla.org/mozilla-central/rev/c2e9792b72d4
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
You need to log in before you can comment on or make changes to this bug.