fune/testing/web-platform/tests/css/css-transitions/pseudo-elements-002.html
Rune Lillesveen 632c445372 Bug 1470626 [wpt PR 11634] - [Squad] Generate ::before/::after/::backdrop in style recalc., a=testonly
Automatic update from web-platform-tests[Squad] Generate ::before/::after/::backdrop in style recalc.

We used to create these pseudo elements and their computed styles in
Element::AttachLayoutTree when building the layout tree. Now we create
or dispose these elements from style recalc, that is,
UpdatePseudoElement. To make pseudo elements live through a style recalc
with a layout tree re-attach we no longer clear the pseudo elements
during DetachLayoutTree for performing_reattach=true. We do however need
to clear the pseudo elements which do not get a layout object for the
re-attach. That is done in AttachLayoutTree for the originating element
when the originating element does not generate a layout box.

We stop using the pseudo style cache on ComputedStyle for PseudoElements
and instead return the ComputedStyle when creating the pseudo element
and store it as non-attached style which can later be retrieved when
attaching the layout object.

An effect of this change is that we can detect transitions on pseudo
elements when ancestors display types changes and causes re-attachment.
That is issue 836140.

::first-letter may still be generated during layout tree building, and
the ::first-letter layout structure may still be updated during style
recalc.

Bug: 836126, 836140
Change-Id: Iafad705b7a7b988d4c1598e8a126ce0d79c5873d
Reviewed-on: https://chromium-review.googlesource.com/1112244
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#571665}

--

wpt-commits: ec35b03ca5e8eec6eb1767a77f0aea13855515a3
wpt-pr: 11634
2018-07-11 08:02:35 +01:00

28 lines
1 KiB
HTML

<!DOCTYPE html>
<title>CSS Transitions Test: Transition pseudo element with ancestor display change</title>
<link rel="author" title="Rune Lillesveen" href="mailto:futhark@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-transitions/#starting">
<link rel="help" href="https://drafts.csswg.org/css-transitions/#transition-property-property">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
#inner::before {
content: "This text should transition from red to green.";
height: 100px;
transition: height steps(2, start) 1s;
}
.flex #inner::before {
height: 300px;
}
.flex { display: flex }
</style>
<div id="outer">
<div id="inner"></div>
</div>
<script>
test(() => {
assert_equals(getComputedStyle(inner, "::before").height, "100px");
outer.className = "flex";
assert_equals(getComputedStyle(inner, "::before").height, "200px");
}, "Check that transitions run on a pseudo element whose ancestor changes display type.");
</script>