-
Notifications
You must be signed in to change notification settings - Fork 27.4k
fix(jqLite): .css() retrieves computed style also #8161
Conversation
Thanks for the PR! Please check the items below to help us merge this faster. See the contributing docs for more information.
If you need to make changes to your pull request, you can update the commit with Thanks again for your help! |
@@ -825,6 +825,17 @@ describe('jqLite', function() { | |||
} | |||
}); | |||
|
|||
it('should get computed styles also', function() { |
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.
remove "also"
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.
@btford sure
It seems it fails for IE versions. I will look on it tomorrow |
Now everything is good. Can you review, please, @btford |
jqLite(document).find('body').append(jqA); | ||
|
||
var style = document.createElement('style'); | ||
style.appendChild(document.createTextNode('#elementA { width: 25px; }')); |
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.
we need to ensure that this style gets removed via finally
or afterEach
@matsko I thought more about this PR. Do we need this feature in ngAnimate? the general policy for jqLite is that unless it's a feature required by Angular we shouldn't add it to jqLite. how is this different from large number of features supported by jQuery but by jqLite? |
@sagens42 my apologies, but we can't put this feature into jqLite. The reasoning being is that the jQuery implementation has a large amount of code to make this work and it's a feature in Angular that isn't worth maintaining (special casing for IE and an internal caching system for repeated calls to getComputedStyle). The other issue is that for any other Angular applications that do not use jQuery and rely on Also, with 2.0, jqLite won't be around anyway. So we're trying to avoid extending it. I will add a commit that explains in the docs exactly why Thanks a bunch for putting the PR together. |
@matsko: Can I find more info on what will happen to jqLite in v2.0 somewhere ? |
@gkalpak from what I know after chatting with @IgorMinar is that in Angular 2.0 jqLite may not be around and we may end up sticking to vanilla ES6 DOM stuff. |
@matsko, thx for the response. vanilla DOM stuff sounds good :) |
Interesting.. I like the idea that jqLite might be removed. It would definitely save headaches around the absence of jQuery idiosyncrasies. But would that mean we would include jQuery? |
nobody really knows for sure yet |
fixes #2866