Include button name/value in form submissions. Full application/xhtml+xml support.#8
Conversation
XHTML tagName normalization is only needed in _elKey() and _mergeHead(), which compare elements across documents. All other tagName checks operate within the same parsing context. Fetched responses are always parsed with DOMParser as text/html, producing uppercase tagNames regardless of the server's Content-Type.
Rewrite the submitter handling from PR #8 for backward compatibility. The original code used new FormData(form, e.submitter) which requires Chrome 111+. The new approach tracks the last clicked submit button via _onClick and falls back to it when e.submitter is not available.
|
Thanks for this PR! The submit button name/value issue is indeed a real bug, good catch. I've merged your PR and made two follow-up changes on top of it: Regarding Regarding the submit button: I've rewritten the |
|
Cute. Claude told me I'm the one hallucinating. It would be one thing to disagree with my proposed solution, but it's an entirely different thing to say the bug I fixed simply doesn't exist and throw out the patch. I just retested with the latest version on jsdelivr. The form submission issue I mentioned in #5 still exists thanks to the removal of the toUpperCase() calls. |
|
I'm sorry you feel that way. I genuinely spent time analyzing both your bug report and your PR, and I appreciate your involvement. A few things I'd like to clarify: About the XHTML issue: In #5, the reproduction context wasn't provided (Content-Type, doctype, etc.), which made it difficult to reproduce the bug on my end. µJS parses all fetched responses with Beyond the technical argument, true XHTML served as That said, if you're still experiencing the issue with the latest version, I'd be happy to investigate further, but I'll need specific reproduction steps: the Content-Type your server returns, a minimal HTML example, and the browser you're testing with. As a practical suggestion: if you're using XHTML mainly for the benefit of XML validation, you can serve your pages with About the PR structure: Your PR contained two unrelated changes (XHTML normalization and submit button handling). The polite and constructive approach would have been to submit two separate PRs, one per concern. It makes review easier, and avoids the situation we're in now where one part is accepted and the other isn't, which can feel frustrating for both sides. About the submit button fix: This is a real bug, and I'm grateful you caught it. I rewrote the implementation for backward compatibility, because About disagreeing with a solution: Reviewing a PR and deciding not to include part of it is a normal part of the process. It doesn't mean the bug doesn't exist; it means I'm not convinced the proposed fix is necessary given how the library works internally. If I'm wrong, a concrete reproduction case will help me understand what I'm missing. |
|
You said,
Which is clearly wrong. Now you say
Which is to my earlier point. If you don't like the solution, that's fine. mujs has features I'll never use and I can save more kilobytes by removing those. I'll just fork off and stay out of your way. Good luck with your project. |
|
When you say "which is clearly wrong", you're not providing any factual evidence. No Content-Type header, no minimal reproduction case, no browser name, no error message. You're asking me to take your word for it and merge code without question. That's not how open-source collaboration works. I've asked multiple times for concrete reproduction steps; the offer still stands. As for forking, that's exactly what open-source licenses are for. I wish you the best of luck with your project. |
Hi again,
I have a couple more bug fixes if you want them.
compare all tagName using toUpperCase except body. replaceWith() works on body elements in application/xhtml+xml and should be used there.
include the submit button's name/value on the submitted form data.