Skip to content

Define implemented pseudo-element for input type=text#217

Merged
nicoburns merged 1 commit intoservo:mainfrom
stevennovaryo:input-text-pseudo-element
Jul 22, 2025
Merged

Define implemented pseudo-element for input type=text#217
nicoburns merged 1 commit intoservo:mainfrom
stevennovaryo:input-text-pseudo-element

Conversation

@stevennovaryo
Copy link
Copy Markdown
Contributor

Define ::placeholder, ::-servo-text-control-inner-editor, and ::-servo-text-control-inner-container. The implemented pseudo elements that support style matching for Input type=text UA Shadow DOM. All of these pseudos will be defined as a lazy and accessible only in UA stylesheet (private).

Contrary to ::placeholder status as a standardized pseudo element, it will be defined as a private pseudo for now due to the lack of property restriction and placeholder for <textarea> being not implemented.

Stylo side of servo/servo#37483

Signed-off-by: stevennovaryo <[email protected]>
@stevennovaryo stevennovaryo changed the title Define Implemented Pseudo Element for Input type=text Define implemented pseudo-element for input type=text Jul 18, 2025
@xiaochengh
Copy link
Copy Markdown
Contributor

The Servo-side code review is finished. Can anyone merge this first?

@mrobinson @Loirooriol @jdm @nicoburns

@nicoburns nicoburns added this pull request to the merge queue Jul 22, 2025
Merged via the queue into servo:main with commit 14c096b Jul 22, 2025
3 checks passed
github-merge-queue bot pushed a commit to servo/servo that referenced this pull request Jul 23, 2025
)

Depends on #37427.

In addition to the changes introduced by
#37065, there are several performance
improvements and nits as follows:
- Use the internal pseudo element for style matching, this will reduce
the performance regression by ~66%.
- Manual construction of the `Text` node inside a text container. This
is followed by the modification of the inner `Text` node instead of
using `SetTextContent` which is more expensive.
- Use `implemented_pseudo_element` instead of
`text_control_inner_editor` `NodeFlag` to handle the special cases that
these elements should follow, specifically the:
  - focus delegation workaround;
  - selections; and
  - line height resolving.
- More documentation.

Servo's side of: servo/stylo#217

Testing: No new unexpected WPT failure, except for the one introduced by
#37065.
Fixes: #36307 #37205

---------

Signed-off-by: stevennovaryo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants