Bug 1284350. Ensure that if a frame is painted it is added to the approximately visible list. r=mstange

This takes the second hunk of https://hg.mozilla.org/mozilla-central/rev/82c3b4b81d82 only, but instead of the "in displayport" list we are adding to the "approximately visible" list. The "in displayport" list doesn't exist after the backouts that need to be done.

This ensures that all visible frames are in the approximately visible list.

By not taking the first chunk of the aforementioned changeset we don't remove frames that aren't painted from the approximately visible list. So the list only grows during a paint. But the next time the we do a full update of approximately visible images it can shrink.

We need this because the video element uses visibility to start/stop decoding (bug 1282710, bug 1299065) and we want frames that are painted to for sure be marked as visible.
This commit is contained in:
Timothy Nikkel 2016-09-12 00:19:08 -05:00
Родитель 0b6fd97ae9
Коммит 97166ec5f2
1 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -2740,6 +2740,13 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
!PresContext()->GetTheme()->WidgetIsContainer(ourDisp->mAppearance))
return;
// Since we're now sure that we're adding this frame to the display list
// (which means we're painting it, modulo occlusion), mark it as visible
// within the displayport.
if (aBuilder->IsPaintingToWindow() && child->TrackingVisibility()) {
child->PresContext()->PresShell()->EnsureFrameInApproximatelyVisibleList(child);
}
// Child is composited if it's transformed, partially transparent, or has
// SVG effects or a blend mode..
const nsStyleDisplay* disp = child->StyleDisplay();