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

Code for comparing .tagName misses .toLowerCase() or .toUpperCase() for XHTML #7959

Closed
T18970237136 opened this Issue Feb 4, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@T18970237136

Hi,

after issue #7849 was closed, I found another bug that manifests when jQuery Mobile 1.4.5 is included in an XHTML page served with a Content-Type of "application/xhtml+xml".

The problem is that when using .tagName of an element, in HTML it will be returned in upper case (e.g. "INPUT") while XHTML as XML is case-sensitive and will return the tag name in lower-case ("input"). jQM has a few lines where the the tag name is compared in upper-case - this will fail in XHTML documents.

I found the following lines in https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.js where the problem occurs:
Line 8336

isTextarea = this.element[ 0 ].tagName === "TEXTAREA",

Line 9215

type: this.element.get( 0 ).tagName

Line 9291

type = element.get( 0 ).tagName,

The code should be changed to either call .tagName.toUpperCase(), or to call .tagName.toLowerCase() and then do a lower-case comparison.

Thanks!

@T18970237136

This comment has been minimized.

Show comment
Hide comment
@T18970237136

T18970237136 Feb 5, 2015

Hi,
I forgot to upload a Testcase. I have created it here (it shows the problem with the flipswitch not recognizing the on and off text): https://gist.github.com/T18970237136/b8af840a32f99b6e5ee5

Hi,
I forgot to upload a Testcase. I have created it here (it shows the problem with the flipswitch not recognizing the on and off text): https://gist.github.com/T18970237136/b8af840a32f99b6e5ee5

gabrielschulhof added a commit to gabrielschulhof/jquery-mobile that referenced this issue Feb 18, 2015

@gabrielschulhof gabrielschulhof added this to the 1.5.0 milestone Feb 18, 2015

@gabrielschulhof gabrielschulhof self-assigned this Feb 18, 2015

gabrielschulhof added a commit to gabrielschulhof/jquery-mobile that referenced this issue Mar 6, 2015

gabrielschulhof added a commit to gabrielschulhof/jquery-mobile that referenced this issue Mar 6, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment