Side navigation
#11166 closed bug (wontfix)
Opened January 12, 2012 12:45PM UTC
Closed October 08, 2012 04:10PM UTC
Last modified August 01, 2014 06:18AM UTC
attr("viewBox") broken by case folding
Reported by: | norman.pellet@gmail.com | Owned by: | timmywil |
---|---|---|---|
Priority: | low | Milestone: | None |
Component: | attributes | Version: | 1.7.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Hi !
May I let you take a look at this fiddle ?
I think there is an issue while retrieving the viewBox attribute with inline svg.
Do I make any sense ?
Thanks !
Attachments (0)
Change History (12)
Changed January 12, 2012 12:48PM UTC by comment:1
Changed January 12, 2012 03:35PM UTC by comment:2
component: | unfiled → attributes |
---|---|
owner: | → timmywil |
priority: | undecided → low |
status: | new → assigned |
Confirmed. http://jsfiddle.net/timmywil/HTZ9n/7/show/
The viewBox
attribute should stay camelCase. SVG may be the only exception where attribute names are not lowercase. http://www.w3.org/TR/SVG/coords.html#ViewBoxAttribute
Changed March 24, 2012 11:32AM UTC by comment:3
Is this perhaps down to the issue described here? http://api.jquery.com/prop/
The element seems retrievable with .prop, but not with .attr.
Changed July 14, 2012 03:17AM UTC by comment:4
summary: | attr("viewBox") doesn't work → attr("viewBox") broken by case folding |
---|
It seems like the DOM attribute methods are case insensitive on sane browsers, so perhaps we can just skip the .toLowerCase()
part? In a quick check to .attr()
I just moved the lowercase to getting the attrHook only and got a full pass including IE7 and IE8. I wasn't able to get a full test in IE6 due to some BrowserStack issues.
In environments where there is case sensitivity (including IE7 HTML) I don't think there is any way to hide that, so documenting that the case must match seems fine to me.
--- a/src/attributes.js +++ b/src/attributes.js @@ -305,8 +305,7 @@ jQuery.extend({ // All attributes are lowercase // Grab necessary hook if one is defined if ( notxml ) { - name = name.toLowerCase(); - hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook ); + hooks = jQuery.attrHooks[ name.toLowerCase() ] || ( rboolean.test( name ) ? boolHook : nodeHook ); } if ( value !== undefined ) {
Changed July 23, 2012 04:35PM UTC by comment:5
Attributes are not case sensitive in IE when using getAttributeNode, which we use for all html attributes in IE. viewBox is technically an svg attribute that should be rendered with xhtml or xml, which is why it is case-sensitive. I think the best solution would be to have a test for svg, if possible.
Changed October 08, 2012 04:10PM UTC by comment:6
resolution: | → wontfix |
---|---|
status: | assigned → closed |
Unfortunately, we don't support SVG, and even though this worked in the past, it's not something we're supporting so we're not going to fix it for now. If we decide to support SVG in the future, we'll reopen and address this issue.
Thanks!
Changed January 12, 2014 11:29AM UTC by comment:7
Requesting that this be re-opened. jQuery 2.x is advertised as supporting modern browsers, all of which support SVG, so fixing it in at least 2.x would be valuable. Also, there is currently no official documentation stating it won't be fixed, as the page for that on docs.jquery.com is gone.
Changed January 12, 2014 08:40PM UTC by comment:8
Replying to [comment:7 anonymous]:
Requesting that this be re-opened. jQuery 2.x is advertised as supporting modern browsers, all of which support SVG, so fixing it in at least 2.x would be valuable. Also, there is currently no official documentation stating it won't be fixed, as the page for that on docs.jquery.com is gone.
Changed January 14, 2014 09:38AM UTC by comment:9
Ah, so that's where the documentation went. OK, so could this be set as "patchwelcome" and made a blocker of #7584?
Changed January 14, 2014 06:19PM UTC by comment:10
Replying to [comment:9 anonymous]:
Ah, so that's where the documentation went. OK, so could this be set as "patchwelcome" and made a blocker of #7584?
At that point of time, it's the other way around - doc will be changed, all svg/vml "patchwelcome" tickets will become "wontfix", but some svg related issues could be addressed, if they would affect wide amount of users.
Changed July 31, 2014 08:52PM UTC by comment:11
#15200 is a duplicate of this ticket.
Changed August 01, 2014 06:18AM UTC by comment:12
Well,
What is the reason to convert characters in attributes to lowercase?
But for normal basic support SVG need only CamelCase notation.
And you do not want to do this thing for many years? Why?
A few more things:
Tested on Firefox 9.0.1, Chrome 17.0.963.33 beta, Safari 5.1.1
worked with jQuery 1.6.4