Closed Bug 1580534 Opened 5 years ago Closed 4 years ago

Canvas with fractional margin has wrong size

Categories

(Core :: Graphics: WebRender, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla73
Tracking Status
firefox73 --- fixed

People

(Reporter: aosmond, Assigned: aosmond)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Before bug 1574493, I believe we passed layout/reftests/bugs/602200-3.html by fluke, rather than actually doing something correct:

https://searchfox.org/mozilla-central/rev/a777ff11b6d700a698c61e5bd17e73b044304494/layout/reftests/bugs/602200-3.html

The snapping code makes the primitive slightly oversized, in a way that is correct and consistent with all other primitives, but for some reason doesn't produce the expected result. This requires further investigation.

Bug 602200 comment 36 describes this test case in more detail. The test case was created because there was a gap between the border and the canvas element. This was an accident of how the different layers would snap, not taking into account the full transform at all layers. As such, there was a bit of a hack added to snap the transforms, to position the border and the canvas flush against one another.

WebRender on the other hand, does what was described as the ideal case. It draws both the border and the canvas flush against one another, taking into account the full transform/margin information. It doesn't need to do the fudging of the transforms, but this means it is effectively shifted to the right by 1 pixel.

I think this may be a case of the test out-living its usefulness, unless we have a good explanation for why we should replicate this exact behaviour.

Historically there were kludges in how we chose to snap layers and
transforms, nominally for performance reasons (see bug 602200 comment
36). WebRender appears to render what was considered at the time the
ideal outcome, which also makes the most sense as a content author.
Given we are otherwise lacking a reason to continue with the old
behaviour, this patch adds a new test case to confirm WebRender snaps in
the ideal fashion, and non-WebRender does not.

Assignee: nobody → aosmond
Pushed by aosmond@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/26d9ba863abc
Add new test case to confirm WebRender snaps in the ideal fashion. r=jrmuizel
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla73
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: