Commit f58907e4 authored by Liquan(Max) Gu's avatar Liquan(Max) Gu Committed by Commit Bot

[FCP++] Exclude body from being captured as background image

In this CL we explicitly exclude body from being captured as a background image.

Before, we assumed that the background image would automatically be transferred
to the layout view. But that's not the case in some examples, as found by the
attached bug.

Bug: 952828
Change-Id: I8f1c97e924ae14e61ac39d7d86af801a93f2863b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1579253
Auto-Submit: Liquan (Max) Gu <maxlg@chromium.org>
Reviewed-by: default avatarSteve Kobes <skobes@chromium.org>
Commit-Queue: Liquan (Max) Gu <maxlg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#654444}
parent 8fa1749d
...@@ -460,7 +460,7 @@ bool ImagePaintTimingDetector::IsBackgroundImageContentful( ...@@ -460,7 +460,7 @@ bool ImagePaintTimingDetector::IsBackgroundImageContentful(
const Image& image) { const Image& image) {
// Background images attached to <body> or <html> are likely for background // Background images attached to <body> or <html> are likely for background
// purpose, so we rule them out. // purpose, so we rule them out.
if (object.IsLayoutView()) { if (object.IsLayoutView() || object.IsBody() || object.IsDocumentElement()) {
return false; return false;
} }
// Generated images are excluded here, as they are likely to serve for // Generated images are excluded here, as they are likely to serve for
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment