Closed Bug 1950372 Opened 19 days ago Closed 19 days ago

innerText is affected by css text-transform: uppercase

Categories

(Core :: CSS Parsing and Computation, defect)

Firefox 122
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: jaborandi, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:136.0) Gecko/20100101 Firefox/136.0

Steps to reproduce:

go to https://ewnjtgouierg.github.io/ffbugs/UpperCaseInnerText.html

Actual results:

innerText = SOMETHING
innerHTML = Something

Expected results:

both should be Something

as the inner text of the span is

it is displayed in upper case, because it has a style attribute with text-transform: uppercase - it is used to STYLE the element, it shouldn't affect the actual data inside it

Summary: innerText is affected by css transform: uppercase → innerText is affected by css text-transform: uppercase

The Bugbug bot thinks this bug should belong to the 'Core::CSS Parsing and Computation' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → CSS Parsing and Computation
Product: Firefox → Core

Per https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/innerText

The innerText property of the HTMLElement interface represents the rendered text content of a node and its descendants.

and https://html.spec.whatwg.org/multipage/dom.html#the-innertext-idl-attribute

  1. If node is a Text node, then for each CSS text box produced by node, in content order, compute the text of the box after application of the CSS 'white-space' processing rules and 'text-transform' rules, set items to the list of the resulting strings, and return items. The CSS 'white-space' processing rules are slightly modified: collapsible spaces at the end of lines are always collapsed, but they are only removed if the line is the last line of the block, or it ends with a br element. Soft hyphens should be preserved. [CSSTEXT]
Status: UNCONFIRMED → RESOLVED
Closed: 19 days ago
Resolution: --- → INVALID

:longsonr thank you and sorry for making you give me lessons in web api here)

You need to log in before you can comment on or make changes to this bug.