Closed Bug 1644468 Opened 4 years ago Closed 4 years ago

XUL trees should invalidate on window focus changes

Categories

(Core :: Web Painting, defect)

defect

Tracking

()

RESOLVED FIXED
mozilla79
Tracking Status
firefox79 --- fixed

People

(Reporter: mstange, Assigned: mstange)

Details

Attachments

(1 file)

XUL trees can contain -moz-appearance widgets whose rendering depends on window focus. At the moment, nothing invalidates the XUL tree when the window focus changes, so those widgets can look incorrect.

Bug 1493789 is going to add another case of this, where the shade of gray of inactive sidebar selections changes a slight amount depending on the window focus state.

It think the easiest way to fix this is to just make the entire XUL tree repaint every time its containing window changes focus.

Pushed by mstange@themasta.com: https://hg.mozilla.org/integration/autoland/rev/53c16c65827a Invalidate XUL trees when window focus changes. r=miko

Wow, that's a footgun and a half. The call to nsDisplayItemGenericImageGeometry::UpdateDrawResult(this, result); in Paint() needs to be updated to call nsDisplayTreeBodyGeometry::UpdateDrawResult instead. UpdateDrawResult a generic static method that happily casts FrameLayerBuilder::GetMostRecentGeometry(aItem) to whatever concrete class it's called on.

Flags: needinfo?(mstange)

I'm really happy we have ASAN tests! They pointed right at the culprit. The crash stacks in the other tests were much less helpful.

Pushed by mstange@themasta.com: https://hg.mozilla.org/integration/autoland/rev/6bc479713c3c Invalidate XUL trees when window focus changes. r=miko

I got the base class wrong :(

I wish there were more compile time checks in this code.

Flags: needinfo?(mstange)
Pushed by mstange@themasta.com: https://hg.mozilla.org/integration/autoland/rev/ddbf6052a717 Invalidate XUL trees when window focus changes. r=miko
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: