Commit 5927cbb8 authored by Anders Hartvoll Ruud's avatar Anders Hartvoll Ruud Committed by Commit Bot

Remove ineffective call to StyleResolver::HasAuthorBackground

As far as I can tell, this check for HasAuthorBackground has never
worked. The function StyleResolver::HasAuthorBackground belongs to the
old code path in the StyleResolver, and in that code path, we'd only
cache the UA style if we had some 'appearance' other than 'none'.
And since we only try to perform the adjustment when we have no
appearance, the function will always return false.

Since this code was introduced [1], we've introduced the
EffectiveAppearance field [2], but as far as I can tell we can only
go from non-none to none if the element is nullptr, in which case
we'll also not attempt the adjustment.

Note also that since M83 (CSSCascade ship), StyleResolver::
HasAuthorBackground has *always* returned false regardless of
circumstance. (It was believed to be unused, but I missed this call
site).

Hence, we can just remove the check.

[1] https://crrev.com/9d6f3016641f26e4e330da6baf70fa2133f62721
[2] https://crrev.com/23a4dcc92d21834769f61c0125edbcf4b1af15dc

Change-Id: I973978e08398ef5906845884b5e133923f6bfb95
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2321309Reviewed-by: default avatarXiaocheng Hu <xiaochengh@chromium.org>
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Cr-Commit-Position: refs/heads/master@{#792879}
parent 185914ab
...@@ -784,9 +784,7 @@ void StyleAdjuster::AdjustComputedStyle(StyleResolverState& state, ...@@ -784,9 +784,7 @@ void StyleAdjuster::AdjustComputedStyle(StyleResolverState& state,
if (is_media_control && !style.HasEffectiveAppearance()) { if (is_media_control && !style.HasEffectiveAppearance()) {
// For compatibility reasons if the element is a media control and the // For compatibility reasons if the element is a media control and the
// -webkit-appearance is none then we should clear the background image. // -webkit-appearance is none then we should clear the background image.
if (!StyleResolver::HasAuthorBackground(state)) { style.MutableBackgroundInternal().ClearImage();
style.MutableBackgroundInternal().ClearImage();
}
} }
if (element && style.TextOverflow() == ETextOverflow::kEllipsis) { if (element && style.TextOverflow() == ETextOverflow::kEllipsis) {
......
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