Skip to content

script: Improve handling of DOMString in <form> escaped values - #44954

Merged
yezhizhen merged 2 commits into
servo:mainfrom
yezhizhen:thanks-for-review
May 16, 2026
Merged

yezhizhen merged 2 commits into
servo:mainfrom
yezhizhen:thanks-for-review

Conversation

@yezhizhen

@yezhizhen yezhizhen commented May 16, 2026 •

Copy link
Copy Markdown
Member

Sorry for the messy title. But there are quite a few things going on.

  1. There was a redundant special casing in fn replace_value. It was already done in

    // Step 5.10: it's a hidden field named _charset_
    InputType::Hidden(_) => {
    if name.to_ascii_lowercase() == "_charset_" {

    It is important to remove it, to make fn replace_value return &DOMString without cloning and String conversion.

  2. Move normalize_crlf to impl DOMString

Testing: Try. This is refactor + removing redundant code.
Part of #10778
Addresses #44953 (comment)

Signed-off-by: Euclid Ye <[email protected]>
@yezhizhen
yezhizhen requested a review from xiaochengh May 16, 2026 10:23
@yezhizhen
yezhizhen requested a review from gterzian as a code owner May 16, 2026 10:23
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label May 16, 2026
@yezhizhen
yezhizhen marked this pull request as draft May 16, 2026 10:39
Signed-off-by: Euclid Ye <[email protected]>
@yezhizhen
yezhizhen force-pushed the thanks-for-review branch from e9367e2 to 3695567 Compare May 16, 2026 10:44
@yezhizhen
yezhizhen marked this pull request as ready for review May 16, 2026 10:45

@TimvdLippe TimvdLippe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I will update the title to make it a bit more concise and readable. Such details are better left for the PR description

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label May 16, 2026
@TimvdLippe TimvdLippe changed the title script: Reduce clone, DOMString conversion for <form>; Remove redundant special casing for <input type="hidden">; Move normalize_crlf to impl DOMString script: Improve handling of DOMString in <form> escaped values May 16, 2026
@yezhizhen
yezhizhen added this pull request to the merge queue May 16, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label May 16, 2026
Merged via the queue into servo:main with commit b360cc5 May 16, 2026
32 checks passed
@yezhizhen
yezhizhen deleted the thanks-for-review branch May 16, 2026 11:53
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label May 16, 2026
pull Bot pushed a commit to AKJUS/servo that referenced this pull request May 16, 2026
This has never been easier thanks to refactor servo#44954 earlier.

Testing: Passing in existing tests.
Part of servo#10778.

---------

Signed-off-by: Euclid Ye <[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