gecko-dev/testing/web-platform/tests/css/css-pseudo/first-letter-and-whitespace-ref.html
Rune Lillesveen cdb91dc5eb Bug 1484967 [wpt PR 12588] - Don't do whitespace re-attachment for ::first-letter., a=testonly
Automatic update from web-platform-testsDon't do whitespace re-attachment for ::first-letter.

If we have a white-space node before the text node with the first
letter, we would try to re-attach the white-space node with an incorrect
previous in-flow LayoutObject because we attach the ::first-letter after
all children have been attached, not where the ::first-letter would end
up in the layout tree.

We don't need to re-attach whitespace after ::first-letter because:

* We always create a remaining LayoutTextFragment for the text node
  which contains the first formatted letter. Wether the remaining text
  consists of white-space or is even empty.

* If the LayoutObject sibling following first-letter+remaining-text
  consists of white-space, it would have gotten a LayoutObject when
  attaching the LayoutText for the text node where the first-letter
  comes from.

That is, we will always have a LayoutObject for a white-space LayoutText
sibling of a first-letter LayoutObject.

Split out a separate method for ::first-letter for less complexity and
cost with which WhitespaceAttacher to use.

Bug: 876150
Change-Id: Ib1f34f0ba596d5fa5f1c7fcbd7c75550dd4f9d12
Reviewed-on: https://chromium-review.googlesource.com/1183231
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584866}

--

wpt-commits: 05f0eb425c0283275fae1fc8f2af437ecf7bf49b
wpt-pr: 12588
2018-08-29 10:08:30 +00:00

11 lines
364 B
HTML

<!doctype html>
<meta charset="utf-8">
<title>CSS Reference File</title>
<link rel="author" title="Rune Lillesveen" href="mailto:futhark@chromium.org">
<p>Pass if no space between "A", space between "B".</p>
<div><span style="float:left">A</span>A</div>
<div><span style="float:left">A</span>A</div>
<div>B B</div>
<div>B B</div>
<div>AAB B</div>
<div>AAB B</div>