#13092 closed bug (wontfix)
vendorPropName (used by jQuery.css) crashes when used on a namespaced element
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | git |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I'm using jQuery in conjuction with webODF, which involves working with namespaced elements. jQuery.css() crashes due to the style element being undefined.
If I manually create a non-namespaced element, jQuery.css() works as expected.
Demonstration code: http://jsbin.com/acuxuc/1/
Change History (10)
comment:1 Changed 10 years ago by
Owner: | set to philip.peitsch@… |
---|---|
Status: | new → pending |
comment:2 Changed 10 years ago by
Status: | pending → new |
---|
Not a recent breakage as far as I'm aware.
Apart from this crash, all other operations I'm using are working correctly. If I put in the necessary "if(!style) return name;" in the vendorPropName method it appears to work for my needs.
comment:3 Changed 10 years ago by
I have confirmed this behaviour is identical in the most recent versions of Chrome and Firefox. Not sure if that is useful for you to know or not however.
comment:4 Changed 10 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
@dmethvin, we should add namespaced elements to the won't fix list along with VML,SVG, and XML.
philip.peitsch@…, thanks for contributing, but unfortunately, this isn't something we're going to fix considering it's edge-casiness and the fact that jQuery isn't intended to work on these elements as they aren't part of HTML.
comment:5 Changed 10 years ago by
comment:6 Changed 10 years ago by
Fortunately, I was able to work around the issue in this case by specifically overriding the cssProps collection for the specific properties used when attempting to locate the position of a given namespaced element.
I'm just recording this here for anyone hitting a problem like this, as potentially a similar workaround might be employed. The following is added to javascript loaded by the affected page:
jQuery.cssProps['position'] = 'position'; jQuery.cssProps['borderTopWidth'] = 'borderTopWidth'; jQuery.cssProps['borderLeftWidth'] = 'borderLeftWidth';
comment:8 Changed 10 years ago by
FYI this page still live: http://contribute.jquery.org/wont-fix/ (support issues with SVG/VML/etc).
comment:9 Changed 10 years ago by
Has this been fixed, I am getting same issue on this code
if (ts != top) {
$('#site').contents().animate({ scrollTop: 0 }, 'slow');
} if (ls != left) {
$('#site').contents().animate({ scrollLeft: 50 }, 'slow');
}
comment:10 Changed 10 years ago by
@rizwanh, the discussion above your post should answer the question. If not, ask for help on a forum.
jQuery hasn't ever worked with namespaces. Many web APIs such as
querySelectorAll
don't support namespaces. Is this something that broke recently?