Skip to content
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

Normalize tag case for true XHTML #12

Closed
wants to merge 1 commit into from
Closed

Normalize tag case for true XHTML #12

wants to merge 1 commit into from

Conversation

sabberworm
Copy link

For compatibility with documents served as application/xhtml+xml, tagName checks need always be normalized.

for compatibility with documents served as application/xhtml+xml
@olivernn
Copy link
Owner

Do you have an example of the issue this is solving, or some steps to re-create your issue?

@sabberworm
Copy link
Author

Steps to reproduce:

  1. Create an XHTML file with a link.
  2. Include jQuery.
  3. Include davis.js and use Davis(jQuery.noop).start().
  4. Serve said file with the Content-Type: application/xhtml+xml MIME Header.
  5. Navigate the browser to the served location. Open the console.
  6. Click on the link.

EXPECTED results:
The log should say: routeNotFound: GET ….

ACTUAL results:
No log entry… Davis did not detect the click.

@sabberworm
Copy link
Author

I think you can also save the HTML file with a .xhtml or .xml extension and open the file in the browser locally to see the error (at least in Firefox).
The reason behind this is that the XML DOM (in contrast to the HTML/SGML DOM) does not do any case-folding on tag names (and attributes).

@olivernn
Copy link
Owner

Ok, I've managed to re-create this now. I'm going to call toUpperCase on the nodeName rather than change the origin checks object as well.

@olivernn
Copy link
Owner

I've just pushed a new release (0.6.1) which fixes this problem.

@olivernn olivernn closed this Sep 28, 2011
@sabberworm
Copy link
Author

Thanks!

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.

2 participants