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

stache: Custom elements in IE8 contain a colon #985

Merged
merged 2 commits into from May 16, 2014

Conversation

Projects
None yet
2 participants
@matthewp
Contributor

matthewp commented May 12, 2014

Using stache, custom elements are being rendered with a colon in IE8 (wrong namespace), that is when you expect: <my-tag></my-tag> you are getting <:my-tag></:my-tag>.

This problem does not occur in Mustache.

The issue is likely caused by stache using cloneNode internally. There are various issues with cloneNode that are solved by jQuery. HTML5 Shiv includes a note in their readme saying that they do not address the cloneNode problem.

Failing test for custom element namespace in IE8
This adds a failing test to the issue where custom elements that have
been registered with can.view.tag are being rendered in IE8 with a
preceding `:` because they lose their namespace. This problem does not
occur in Mustache.

The issue is likely caused by stache using cloneNode internally. There
are various issues with cloneNode that are solved by jQuery and HTML5
Shiv includes a note in their readme that they do not address the
cloneNode problem.

matthewp added a commit to matthewp/canjs that referenced this pull request May 13, 2014

Fix for custom tags in IE8 using stache
This fixes a bug where custom tags used in IE8 would result in the tags
not being part of the document's namespace and therefore would be
rendered like: <:my-tag></:my-tag>.  This would also break for
non-custom tags like <header> and <footer> because stache uses
`cloneNode` which is not fixed by html5shiv.

The fix is a custom `cloneNode` for browsers with this issue that
recursively creates elements as a replacement for the browser's
cloneNode. Fixes #985
Fix for custom tags in IE8 using stache
This fixes a bug where custom tags used in IE8 would result in the tags
not being part of the document's namespace and therefore would be
rendered like: <:my-tag></:my-tag>.  This would also break for
non-custom tags like <header> and <footer> because stache uses
`cloneNode` which is not fixed by html5shiv.

The fix is a custom `cloneNode` for browsers with this issue that
recursively creates elements as a replacement for the browser's
cloneNode. Fixes #985

@ccummings ccummings added the Bug label May 16, 2014

@ccummings ccummings added this to the 2.1.1 milestone May 16, 2014

ccummings added a commit that referenced this pull request May 16, 2014

Merge pull request #985 from matthewp/stache-ie8
stache: Custom elements in IE8 contain a colon

@ccummings ccummings merged commit acd628a into canjs:master May 16, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details

gsmeets pushed a commit to gsmeets/canjs that referenced this pull request Aug 15, 2014

Fix for custom tags in IE8 using stache
This fixes a bug where custom tags used in IE8 would result in the tags
not being part of the document's namespace and therefore would be
rendered like: <:my-tag></:my-tag>.  This would also break for
non-custom tags like <header> and <footer> because stache uses
`cloneNode` which is not fixed by html5shiv.

The fix is a custom `cloneNode` for browsers with this issue that
recursively creates elements as a replacement for the browser's
cloneNode. Fixes #985
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment