Skip to content

.css('marginRight') may not be accurate for negative percent margins in Android 4.0-4.3 #865

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

Closed
timmywil opened this issue Jan 15, 2016 · 11 comments
Assignees

Comments

@timmywil
Copy link
Member

See jquery/jquery#1815

Retrieving negative percent margin-right in Android 4-4.4 may not return expected values. This is unfortunate, but necessary until we drop support for Android 2.3.

@dmethvin
Copy link
Member

If we have to choose, maybe we should make Android 2.3 lose this contest?

@AurelioDeRosa
Copy link
Member

I'll wait before submitting a PR for this as it seems there is room for discussion.

@AurelioDeRosa AurelioDeRosa self-assigned this Jan 16, 2016
@AurelioDeRosa
Copy link
Member

Any update on this issue?

@AurelioDeRosa
Copy link
Member

Friendly ping @dmethvin and @timmywil.

@mgol mgol changed the title .css('marginRight') may not be accurate for negative percent margins in Android 4-4.4 .css('marginRight') may not be accurate for negative percent margins in Android 4.0-4.3 Feb 25, 2016
@mgol
Copy link
Member

mgol commented Feb 25, 2016

It's Android 4.0-4.3, not 4.4. Android 4.4 doesn't have the Android Browser.

Also, I think you confused the issue a little, @timmywil - it's not Android 2.3 that's the problem here. There's a bug in Android 4.0-4.3 only (it actually worked fine in 2.3): getComputedStyle sometimes returns percents instead of the pixel value for some values. The workaround for this bug causes the issue with negative percent margins but we decided that's a lesser evil, especially that it worked like that for a long time.

This issue is valid, it's something we need to document for Android 4.0-4.3.

@mgol
Copy link
Member

mgol commented Feb 25, 2016

This is my PR that fixes the percent-instead-of-pixel bug in Android 4.0-4.3 but causes the one we need to document here: jquery/jquery#1842.

@dmethvin
Copy link
Member

Is this something we should even attempt to document?

@mgol
Copy link
Member

mgol commented Feb 25, 2016

@dmethvin always asking the difficult questions! 😄

Probably not too many people care about negative percent margins in Android 4.0-4.3. But we don't seem to have many such bugs accepted in various browsers, do we? We might as well document it, at least at https://contribute.jquery.org/wont-fix/.

@dmethvin
Copy link
Member

That does sound like a better fit for wont-fix I think. Also, with Google and StaclOverflow I think it is legit to have comments like these act as documentation. We can't have yellow-box warnings sprinkled around every API call for each quirk of particular browsers, and this is an obscure one.

So basically the wont-fix text is something like?

Negative margins on Android 4.0-4.3 browser: These browsers return incorrect values from the DOM getComputedStyle method which causes jQuery to return the wrong value.

@mgol
Copy link
Member

mgol commented Feb 25, 2016

@dmethvin Sounds good. And good points. 👍

@AurelioDeRosa
Copy link
Member

This issue has been documented in the contribute website. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants