New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
assertion failed: self.is_char_boundary(new_len) in DOMString::strip_leading_and_trailing_ascii_whitespace #21963
Comments
We could solve this by calling split_at on the index that is found, and calling char_indices on the second string then using |
Hi! If you have any questions regarding this issue, feel free to make a comment here, or ask it in the If you intend to work on this issue, then add |
We'll want to add a new testcase to tests/wpt/mozilla/tests/mozilla/ that verifies the value of the |
Can I take this on? |
Please do! Ask questions if anything is unclear! |
Fixes panic on DOMString::strip_leading_and_trailing_ascii_whitespace <!-- Please describe your changes on the following line: --> This changes `DOMString::strip_leading_and_trailing_ascii_whitespace` to handle multi-byte unicode characters. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #21963 (github issue number if applicable). <!-- Either: --> - [X] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21978) <!-- Reviewable:end -->
Fixes panic on DOMString::strip_leading_and_trailing_ascii_whitespace <!-- Please describe your changes on the following line: --> This changes `DOMString::strip_leading_and_trailing_ascii_whitespace` to handle multi-byte unicode characters. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #21963 (github issue number if applicable). <!-- Either: --> - [X] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21978) <!-- Reviewable:end -->
Found with domato.
The beta character is encoded as
ce b2
, so it's weird that an ascii whitespace function tries to split it at a non-char boundary.Debug backtrace
The text was updated successfully, but these errors were encountered: