Commit de5c1819 authored by Rune Lillesveen's avatar Rune Lillesveen Committed by Commit Bot

Do not override kReattach for ::first-letter.

We incorrectly did an override with kForce for ::first-letter recalc
when we were already recalculating style for re-attachment (kReattach).
This caused crashes in FirstLetterPseudoElement::DidRecalcStyle.

Bug: 853621, 853476, 853471, 853470, 853433, 853411
Change-Id: Id34e6bdbaaeb3b4933a3e963b68f0bffcda0e40e
Reviewed-on: https://chromium-review.googlesource.com/1104176
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Reviewed-by: default avatarAnders Ruud <andruud@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568006}
parent e792609b
<!DOCTYPE html>
<span style="color:green">This text should be green.</span>
<!DOCTYPE html>
<title>CSS Test: ::first-letter stops applying to element becoming inline.</title>
<link rel="author" title="Rune Lillesveen" href="mailto:futhark@chromium.org">
<link rel="match" href="first-letter-block-to-inline-ref.html">
<link rel="help" href="https://drafts.csswg.org/css-pseudo-4/#first-letter-pseudo">
<style>
#outer.block::first-letter { color: red }
#outer.block { display: block }
</style>
<span id="outer" class="block">
<span id="inner">This text should be green.</span>
</span>
<script>
outer.offsetTop;
outer.className = "";
inner.style.color = "green";
</script>
......@@ -2205,8 +2205,9 @@ void Element::RecalcStyle(StyleRecalcChange change) {
// checks as we don't know if they effected the first letter or not.
// This can be seen when a child transitions from floating to
// non-floating we have to take it into account for the first letter.
UpdatePseudoElement(kPseudoIdFirstLetter,
ChildNeedsStyleRecalc() ? kForce : change);
UpdatePseudoElement(
kPseudoIdFirstLetter,
change < kForce && ChildNeedsStyleRecalc() ? kForce : change);
ClearChildNeedsStyleRecalc();
}
......
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