Closed Bug 1365511 Opened 3 years ago Closed 3 years ago

Fix nsDisplayXULImage size problem which will cause some failures when turning on background color layer

Categories

(Core :: Graphics: WebRender, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: ethlin, Assigned: ethlin)

References

Details

Attachments

(1 file)

nsDisplayXULImage calculates destination rect at [1], but the real painting destination rect is here [2]. The two rect are different when the mUseSrcAttr is true.


[1] https://dxr.mozilla.org/mozilla-central/source/layout/xul/nsImageBoxFrame.cpp#496
[2] https://dxr.mozilla.org/mozilla-central/source/layout/xul/nsImageBoxFrame.cpp#380
A related test is "layout/reftests/xul/object-position-png-001.xul". I can reproduce the same problem with webrender off and background color layer on. In this patch, nsDisplayXULImage will call nsImageBoxFrame::GetDestRect to get the same destination rect. I also slightly change the order of checks in nsImageBoxFrame::PaintImage to make it more reasonable.
Attachment #8868420 - Flags: review?(matt.woodrow)
Attachment #8868420 - Flags: review?(matt.woodrow) → review+
Pushed by ethlin@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b204857f08a1
Correct nsDisplayXULImage destination rect. r=mattwoodrow
https://hg.mozilla.org/mozilla-central/rev/b204857f08a1
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.