-
Notifications
You must be signed in to change notification settings - Fork 20.6k
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
Follow-up for #8908 fix #1036
Follow-up for #8908 fix #1036
Conversation
Most of this looks good to me! Renaming the function does make its goal clearer. On your point 3, the bug in http://jsfiddle.net/3bAvn/ is currently fixed by this patch isn't it? Why remove the patch in css.js? |
On your point 3, the bug in http://jsfiddle.net/3bAvn/ is currently fixed by this patch isn't it? nope, this is a main reason why i opened this pull, but not only that test case is problem, current fix is not fixes even I updated pull to address this issue too, now things are much more simpler. |
Hmm, @Orkel I'm not seeing an issue in that last jsFiddle you mentioned. I add some more console.logs and here is a screenshot in IE10 from browserstack and in a VM I have locally http://cl.ly/image/31311T392M0D via http://jsfiddle.net/3s8EH/5/ I do see the issue you mentioned above about the children having a problem. I updated your jsFiddle a little and yes, it shows the same issue about children having the same issue (as @dmethvin thought there could be an issue the other day) http://jsfiddle.net/4uK6R/ |
Hmm, @Orkel I'm not seeing an issue in that last jsFiddle you mentioned. I add some more console.logs and here is a screenshot in IE10 from browserstack and in a VM I have locally http://cl.ly/image/31311T392M0D via http://jsfiddle.net/3s8EH/5/ That's weird, indeed, browserstacks ie10 does not show it, but mine ie10 does. Judging by Wikipedia article i have last stable version... |
This needs a rebase |
@gnarf37 done. |
@@ -196,6 +196,12 @@ jQuery.extend({ | |||
value += "px"; | |||
} | |||
|
|||
// Fixes #8908, it can be done more correctly by specifing setters in cssHooks, | |||
// but it would mean to define eight (for every problematic property) identical functions | |||
if ( value === "" && ~name.indexOf("background") ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though most of us can read the ~name.indexOf
I think we prefer name.indexOf() !== -1
for readability.
cc @rwldrn @dmethvin to confirm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's less obvious to someone unfamiliar with bitwise operators.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah the bitwise op is not as obvious. In this case we're looking for strings starting with "background" right? So you could check for 0 and use !name.indexOf()
but checking for -1 is probably the most obvious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're looking for "background" at the beginning, then the condition should just be that: name.indexOf("background") === 0
. The intention won't be mistaken and we're spared the cost of coercion (though likely negligible)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name.indexOf("background") === 0
and it saves two bytes... done
Random question - should that test be in css or manipulation? cc @mikesherov |
@gnarf37 Though most of us can read the ~name.indexOf I think we prefer name.indexOf() !== -1 for readability. judging by the source, you use Random question - should that test be in css or manipulation? Well, i changed css module, so i added tests to it. |
Well, i changed css module, so i added tests to it. Sorry, not me, @elijahmanor did. |
@gnarf37, I think it belongs in either one, but probably better in css.js for dependency sake. |
@Orkel can you rebase? done |
@elijahmanor, @dmethvin
Didn't mean to step on any toes here, but unfortunately fix for #8908 is incomplete
First of all, this comment is incorrect, it should 8908 not 8909, simple typo there is.
This assignment is redundant, JSHint is now ok without it.
But what more important, these lines, in my opinion, should be in
cloneFixAttribute
function, although function name might be confusing.getComputedStyle
on xml nodes.nodeType
,cloneFixAttribute
already do that.You might already talked about this, and some perfomance decrease might be an issue, but it felt important to bring this up.