Revision ec35b03ca5e8eec6eb1767a77f0aea13855515a3 authored by Rune Lillesveen on 29 June 2018, 22:17:37 UTC, committed by Blink WPT Bot on 29 June 2018, 22:26:52 UTC
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}
1 parent c360ca0
Raw File
position-relative-table-tr-left.html
<!DOCTYPE html>
<title>position:relative top constraint should behave correctly for &lt;tr&gt; elements</title>
<link rel="match" href="position-relative-table-left-ref.html" />
<link rel="help" href="https://www.w3.org/TR/css-position-3/#rel-pos" />
<meta name="assert" content="This test checks that the position:relative top constraint behaves correctly for &lt;tr&gt; elements" />

<style>
table {
  border-collapse:collapse;
}

td {
  padding: 0;
}

td > div {
  height: 50px;
  width: 50px;
}

.group {
  display: inline-block;
  position: relative;
  width: 150px;
  height: 200px;
}

.indicator {
  position: absolute;
  background-color: red;
  left: 100px;
  height: 50px;
  width: 50px;
}

.relative {
  position: relative;
  left: 100px;
  background-color: green;
}
</style>

<div class="group">
  <div>
    <div class="indicator"></div>
    <table>
      <tbody>
        <tr class="relative"><td><div></div></td></tr>
        <tr><td><div></div></td></tr>
        <tr><td><div></div></td></tr>
        <tr><td><div></div></td></tr>
      </tbody>
    </table>
  </div>
</div>

<div>You should see a green box above. No red should be visible.</div>

back to top