gecko-dev/testing/web-platform/tests/css/css-pseudo/first-letter-text-and-display-change.html
Rune Lillesveen 6afee2d4f1 Bug 1625279 [wpt PR 22479] - Missing ClearNeedsStyleRecalc() for ::first-letter., a=testonly
Automatic update from web-platform-tests
Missing ClearNeedsStyleRecalc() for ::first-letter.

A FirstLetterPseudoElement is marked for style recalc when the text node
the first letter belongs to is removed from the DOM tree. On the next
style recalc, if the first-letter's originating element is inside a
subtree marked for layout tree re-attachment, or one of its descendants
are marked for re-attachment, we delay the first-letter style update
until UpdateFirstLetterPseudoElement is called for the
kRebuildLayoutTree or kAttachLayoutTree phases. For the former, we call
RecalcStyle which will ClearNeedsStyleRecalc, but ofr the
kAttachLayoutTree phase, we called StyleForLayoutObject without clearing
the dirty flag.

Bug: 1064595
Change-Id: Ibebb9c358b473f61b1cff49a7c5ec43bf6894408
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2122347
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#753806}

--

wpt-commits: a5094e5aa21dede70be07dc94f41ad7e8ca6d48b
wpt-pr: 22479
2020-03-31 11:31:19 +00:00

18 lines
698 B
HTML

<!doctype html>
<title>CSS Test: Change display for the ::first-letter container while replacing text node</title>
<link rel="help" href="https://drafts.csswg.org/css-pseudo/#first-letter-pseudo">
<link rel="match" href="../reference/pass_if_letter_uppercase.html">
<style>
#container::first-letter { text-transform: uppercase }
#container.ib { display: inline-block }
</style>
<body>
<p>Test passes if the letter "F" in the words "Filler Text" below is in upper-case.</p>
<div id="container">Test not run</div>
</body>
<script>
container.offsetTop;
container.className = "ib";
container.appendChild(document.createTextNode("filler Text"));
container.firstChild.remove();
</script>