Three WPT reftests from
external/wpt/css/css-text/white-space/ rendered in
content_shell. Each test lays divs with
width: max-content, a red background, and an inner
green span over text ending in a Unicode Zs (space-separator)
character other than SPACE or NO-BREAK SPACE. The test passes when
the trailing Zs hangs outside the line's intrinsic width:
the green span covers the whole box and no red pixel is visible.
The test fails when the Zs char inflates max-content: the next
line of "xx" does not fill the box and red leaks through.
Left column: current origin/main parent (CL hunks
reverted). Right column: the same binary rebuilt with CL 8819998
applied. Nothing else changes between the two shots — same
out/perf/content_shell, same xvfb, same HTML file.
U+1680, U+2000–U+200A,
U+202F, U+205F, U+3000.
All rendered absolutely-positioned at the same origin, so the
topmost layer is what you see.
white-space:
pre-line instead of pre. Collapses runs of
whitespace but preserves line breaks.
pre-line.
white-space: nowrap — no soft
wrapping, so the entire sequence lives on one line.
Character::IsOtherSpaceSeparator() went from recognising
only U+3000 IDEOGRAPHIC SPACE to all 15 Unicode Zs
(Space_Separator) characters except U+0020 SPACE and
U+00A0 NO-BREAK SPACE, matching CSS Text 3's definition
of other space separators.
// third_party/blink/renderer/platform/text/character.h
template <typename CharacterType>
inline bool IsOtherSpaceSeparator(CharacterType c) {
return c == uchar::kOghamSpaceMark ||
(c >= uchar::kEnQuad && c <= uchar::kHairSpace) ||
c == uchar::kNarrowNoBreakSpace ||
c == uchar::kMediumMathematicalSpace ||
c == uchar::kIdeographicSpace;
}
Supporting changes land in
line_breaker.cc (hang handling in
HandleTextForFastMinContent, intrinsic-size fallback in
ComputeLineLocation, and
SplitTrailingBidiPreservedSpace),
shaping_line_breaker.cc (guard the early-return with
IsAllSpaces()),
line_info.cc (null-shape_result skip in
ComputeTrailingSpaceWidth),
inline_node.cc (don't derive max-size from min-size when
the line has trailing hanging spaces), and
text_break_iterator.cc (new
IsBreakableOtherSpaceSeparator keeps U+2007
and U+202F UAX#14-glue under break-spaces).
wpt-001.html (pre) wpt-003.html (pre-line) wpt-004.html (nowrap) reference CL src hunks (patch)