Bug Tracker

Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#13767 closed bug (wontfix)

left: auto on positioned elements is not converted to pixels by css() on WebKit

Reported by: m_gol Owned by:
Priority: low Milestone: 1.11/2.1
Component: css Version: 2.0.0-beta3
Keywords: blinkBroken Cc:
Blocked by: Blocking:

Description (last modified by m_gol)

Test case: http://jsfiddle.net/m_gol/QzvH5/9/

Original report (bugs.jquery.com was down) and pull request:
https://github.com/jquery/jquery/pull/1240

Change History (12)

comment:1 Changed 6 years ago by m_gol

Description: modified (diff)

comment:2 Changed 6 years ago by m_gol

Summary: left: auto on positioned elements is not converted to piksels by css() on WebKitleft: auto on positioned elements is not converted to pixels by css() on WebKit

comment:3 Changed 6 years ago by timmywil

Component: unfiledcss
Priority: undecidedlow
Status: newopen

comment:4 Changed 6 years ago by anonymous

new pr:

https://github.com/jquery/jquery/pull/1241

make left/top auto value consistent across browsers

tests:

http://jsfiddle.net/yiminghe/Yu9sP/1/

comment:5 Changed 6 years ago by yiminghe

Last edited 6 years ago by yiminghe (previous) (diff)

comment:6 Changed 6 years ago by m_gol

Milestone: None1.11/2.1

comment:7 Changed 6 years ago by m_gol

@mikesherov, what do you think about always returning pixels if possible, i.e. ignoring the getComputedStyle spec part that says about non-positioned elements? Otherwise we'll keep getting these kind of problems until .usedStyle and friends actually get implemented.

comment:8 Changed 6 years ago by m_gol

It seems we lean towards not caring about non-positioned element at all (though we have to discuss it with the team during a meeting). It will require documenting that, obviously.

comment:9 Changed 5 years ago by mikesherov

Keywords: webkit blink upstream added
Resolution: wontfix
Status: openclosed

For this case, asking for .left on a position static element is non-sensical. Any value other than 0 doesn't make sense, but we're not going to patch over it for now. Rather, we're going to surface this behavior up to the working groups.

comment:10 Changed 5 years ago by mikesherov

Keywords: blinkBroken added; webkit blink upstream removed

comment:11 Changed 5 years ago by m_gol

mikesherov: this ticket is not about fixing .css('left') on a static element, it was just one of points that we wondered what to do about. The issue concerns positioned elements with 'left' set to 'auto'. What's your position on that?

comment:12 Changed 5 years ago by m_gol

To add to the above - if the only change added was the computed === "auto" test in one place, we'd get only +7 bytes gzipped.

Note: See TracTickets for help on using tickets.