Commit 19e420c6 authored by Rune Lillesveen's avatar Rune Lillesveen Committed by Commit Bot

Load pending resources after style adjustments.

We don't fetch resources for ComputedStyle which is in a display:none
subtree or display:contents since [1]. Style adjustments are done to the
display type in the StyleAdjuster and we need to make sure we load
resources where display changes from a non-rendered value to a rendered
one after style adjustments.

Specifically, this happens with blockification of :root elements which
are display:contents.

[1] https://crrev.com/caf740f6c0b57ca102026f40f3cc62f9f3cf5159

Bug: 1085750
Change-Id: I7686c6f8bf4918bec5812d1bf893ad2c4cb9262c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2214897Reviewed-by: default avatarAnders Hartvoll Ruud <andruud@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#771748}
parent 7fed1513
...@@ -910,6 +910,8 @@ scoped_refptr<ComputedStyle> StyleResolver::StyleForElement( ...@@ -910,6 +910,8 @@ scoped_refptr<ComputedStyle> StyleResolver::StyleForElement(
if (state.Style()->HasGlyphRelativeUnits()) if (state.Style()->HasGlyphRelativeUnits())
UseCounter::Count(GetDocument(), WebFeature::kHasGlyphRelativeUnits); UseCounter::Count(GetDocument(), WebFeature::kHasGlyphRelativeUnits);
state.LoadPendingResources();
// Now return the style. // Now return the style.
return state.TakeStyle(); return state.TakeStyle();
} }
...@@ -1212,8 +1214,10 @@ scoped_refptr<ComputedStyle> StyleResolver::PseudoStyleForElement( ...@@ -1212,8 +1214,10 @@ scoped_refptr<ComputedStyle> StyleResolver::PseudoStyleForElement(
} }
if (PseudoElement* pseudo_element = if (PseudoElement* pseudo_element =
element->GetPseudoElement(pseudo_style_request.pseudo_id)) element->GetPseudoElement(pseudo_style_request.pseudo_id)) {
SetAnimationUpdateIfNeeded(state, *pseudo_element); SetAnimationUpdateIfNeeded(state, *pseudo_element);
state.LoadPendingResources();
}
// Now return the style. // Now return the style.
return state.TakeStyle(); return state.TakeStyle();
......
<!doctype html>
<html style="background:green">
<title>CSS Test Reference</title>
<p>Pass if the background is green.</p>
<!doctype html>
<title>CSS Test: display:contents on root element blockified with rendered background.</title>
<link rel="help" href="https://drafts.csswg.org/css-display/#the-display-properties">
<link rel="help" href="https://drafts.csswg.org/css-display/#transformations">
<link rel="match" href="display-contents-root-background-ref.html">
<style>
:root {
display: contents;
background-image: url(../support/1x1-green.png);
}
</style>
<p>Pass if the background is green.</p>
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