New issue
Advanced search Search tips

Issue 857318 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

CSS text-transform in ::first-line doesn't work well in text-transform specified to block

Project Member Reported by yosin@chromium.org, Jun 28 2018

Issue description

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().


 

Sign in to add a comment