Repository navigation
🤖 avm1: Report XML status -9 for unmatched start-tags - #25083
nazem-droubi wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
I'm opening this as a draft so I can review it myself before marking it ready.
Please don't do that. It's fine to open as a draft so that others can review a WIP, but you should review the code before opening the PR. We already have too many PRs open.
Not to mention reviewers won't get notified when you are ready and it's wasting our CI resources.
As mentioned in the template, you don't need to say that, CI takes care of it. This sentence means nothing because every PR has to pass it. |
|
Thanks — removed that sentence from the description. CI covers it. |
evilpie
left a comment
There was a problem hiding this comment.
Only the second commit should have tests. Also make the commit message that actually describes what is being test.
Flash returns -9 when an end-tag closes the element directly above the open one, as in `<a><b>foo</a>`, and when elements are still open at the end of the input. Ruffle returned -10 for the first case and 0 for the second. Other mismatched or unmatched end-tags still give -10. Fixes ruffle-rs#24337.
Cover XML.status for one-level-up mismatched end-tags, including `<a><b>foo</a>` and the crossed-tag case `<a><b>foo</a></b>`, and for EOF while elements are still open. Those cases return -9. Other mismatched or unmatched end-tags return -10. Traces use the multi-line case/returned/toString format and were recorded from Flash Player 32.
48d577e to
272a4c7
Compare
|
Please remove the following from the commit message. You can't be your own co-author.
Otherwise looks good. |
272a4c7 to
b59074d
Compare
|
Removed the Co-authored-by trailer from both commits. Thanks for the review. |
Description
Fixes #24337.
XML.statusshould be -9 ("a start-tag was not matched with an end-tag") in two cases where Ruffle reported something else:<a><b>foo</a>. Ruffle gave -10.<a>foo. Ruffle gave 0.I ran a set of inputs in the Flash Player 32 debug projector first. They show that -9 applies only when the end-tag names the element one level up. If it names an element further up, as in
<a><b><c>foo</a>, or an element that isn't open, Flash still returns -10. So mapping every quick-xmlMismatchedEndTagto -9 would be wrong. This PR returns -9 only when the end-tag matches the parent of the open element, and sets -9 at EOF when elements are still open. The parsed tree doesn't change: in every case the test covers, Ruffle and Flash already produce the sametoString().Testing
avm1/xml_status_mismatched_tags, compiled with Rascal. It covers 21 inputs: the -9 cases (including crossed tags like<a><b>foo</a></b>), the -10 cases next to them, unmatched end-tags, input ending with elements still open, and well-formed input. It traces each case in a multi-linecase/returned/toStringformat.output.txtwas recorded with the Flash Player 32 Linux debug projector (cargo testutils execute -s). The test fails without the fix.Checklist
AI disclosure: an AI coding agent working on my behalf wrote the code, the test, and this description, and ran the test in Flash Player. I'll handle any review discussion personally.