Side navigation
#13866 closed bug (wontfix)
Opened May 07, 2013 04:07PM UTC
Closed May 07, 2013 09:56PM UTC
Last modified May 08, 2013 03:49AM UTC
$.fn.css should work (not crash) on the document
Reported by: | jbedard | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.9.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Since 13832 won't be fixed I think all standard jQuery methods should work on the document. The only one I've found which doesn't is $.css: $("html").parent().css("color") crashes.
It seems like it doesn't always crash though, after doing $("html").css("color") once $("html").parent().css("color") starts working (returning undefined) in chrome/IE8. Firefox seem to always crash and has a different error then chrome.
Attachments (0)
Change History (2)
Changed May 07, 2013 09:56PM UTC by comment:1
resolution: | → wontfix |
---|---|
status: | new → closed |
Changed May 08, 2013 03:49AM UTC by comment:2
This is fetching styles, not setting them. Even if it throws it would be nice if it was consistent, even within a single browser it is not consistent right now. This might just mean adding a null check, I don't see how that is overkill..?
This seems like overkill. There are valid use cases for allowing
.parent()
to return a document, but doesn't mean we need to fail silently when trying to set styles on a non-element. In fact, an exception may even be preferred in that case because the user needs to know that it's pointless to try to set that.