Closed Bug 1716436 Opened 4 years ago Closed 4 years ago

Consider not paint (i.e. paint with empty rect) OOP iframe if we haven't received EffectsInfo from the parent content

Categories

(Core :: Web Painting, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
92 Branch
Fission Milestone MVP
Tracking Status
firefox92 --- fixed

People

(Reporter: hiro, Assigned: tnikkel)

References

Details

Attachments

(2 files)

In nsLayoutUtils::PaintFrame() we apply BrowserChild's visible rect to clip the given frame's ink-overflowed rect. [Timothy raised a concern] that if we haven't received EffectsInfo and if the frame is quite large then we try to paint the whole frame rect.

Note that helper_fission_animation_styling_in_oopif.html is a test case you can see the case we haven't received EffectInfo.

Note that if we have display port margins then we should be okay. There are two cases to consider, either we have a display port base rect set or we don't. If one is not set we assume an empty base rect

https://searchfox.org/mozilla-central/rev/fbc78630d6d435b9b9647a4ac8a5def888f85f04/layout/base/DisplayPortUtils.cpp#260

which is okay. If the base rect is set then it should be set to only include what is visible. Although I guess we don't change our visible rect to the displayport until we enter the root scroll frame, so that is something to look into.

To fix this there are two ideas so far: 1) use an empty visible rect if the effects info visible rect hasn't been set yet, or 2) use the screen size to bound what is drawn.

Possible downsides for 1):
-potential for not painting an iframe when it is user visible
-possible that we decrease perf because the first time we ask the iframe to paint the visible rect is empty but its actually visible so now we have to wait longer for it to be painted

Possible downsides for 2):
-have to make sure the screen size is available in oop if child processes
-can we get the screen size in a low overhead way?

For reference the changeset that prompted this line of thought, and something that we need to consider to make sure we are setting the base rect properly is https://phabricator.services.mozilla.com/D116577

See Also: → 1562720

Timothy, is this bug strictly a performance optimization or does it affect what users see? Do you think this bug is important to fix before we ship Fission?

Tentatively tracking for Fission MVP milestone.

Fission Milestone: --- → MVP

The importance of this bug is that pages can have arbitrarily large iframes, if we haven't received a visible rect for the oop if, and there aren't displayport margins set yet then we could try to allocate arbitrarily sized surfaces to try to paint it. We definitely do not want to allow web content to do that.

Timothy, do you think we should fix this bug for Fission MVP? If so, can someone on the Web Painting team take this bug? Otherwise, I can move it from blocking Fission MVP to our Future backlog.

Flags: needinfo?(tnikkel)

I think probably MVP. I can take this.

Assignee: nobody → tnikkel
Flags: needinfo?(tnikkel)
Attached patch screensizelimitSplinter Review

Here's a patch that does a screen size limit just for reference if we ever need to revisit this in the future.

Pushed by tnikkel@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8a38c9a1d317 If a visible rect hasn't been set yet for an oop if, use an empty rect so as to bound it's content. r=hiro
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 92 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: