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

Fix Firefox XML namespace handling incompatibilities in package document parser #29

Merged
merged 1 commit into from
Mar 24, 2014

Conversation

aadamowski
Copy link
Member

Hi!

When working on the readium-js data model, I've discovered a bug on non-WebKit browsers. On WebKit, jQuery selectors against XML DOM work without regard for XML namespaces. On the other hand, other engines do the opposite - they won't match an element if in the original document it's physically prefixed with a namespace prefix. In such a case, they require matching against the full element name (prefix:localName), which is not portable (the used prefix can change from document to document).

My partial fix (more complex jQuery selectors still need conversion, as noted in the TODO comment) is to use the getElementsByTagNameNS() function, with a "*" namespace wildcard, based on information from this article: http://wiki.orbeon.com/forms/doc/contributor-guide/browser#TOC-Get-elements-with-prefixes.

This approach should also work for IE9 and IE10 (but not for IE <= 8).

…ent parser

by using getElementsByTagNameNS() instead of jQuery selectors that
behave differently on WebKit than on other engines.
bormind added a commit that referenced this pull request Mar 24, 2014
…nt-parsing

Fix Firefox XML namespace handling incompatibilities in package document parser
@bormind bormind merged commit 5e4f0b5 into develop Mar 24, 2014
@aadamowski aadamowski deleted the hotfix/firefox-xml-package-document-parsing branch June 10, 2014 23:09
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