https://jsfiddle.net/5pzotyfc/8/
Expected: "Abcxyz" and "BOX"
Actual: "ABCXYZ" and "BOX"
Note: "abc" and "xyz" are in different Text nodes.
In legacy, text-transform in ::first-line is done by
InlineTextBoxPainter::Paint() and it does text transform by
ComputedStyle::ApplyTextTransform() with
// string from LayoutText which is applied text-transform.
const String& layout_item_string =
inline_text_box_.GetLineLayoutItem().GetText();
String first_line_string;
if (inline_text_box_.IsFirstLineStyle()) {
first_line_string = layout_item_string;
const ComputedStyle& style = inline_text_box_.GetLineLayoutItem().StyleRef(
inline_text_box_.IsFirstLineStyle());
// Apply text transform
style.ApplyTextTransform(
&first_line_string,
inline_text_box_.GetLineLayoutItem().PreviousCharacter());
In LayoutNG, NGInlineNode::ShapeTextForFirstLineIfNeeded() checks TextTransform()
and calls ComputedStyle::ApplyTextTransform().