Ticket #8945 (closed bug: worksforme)
[webkit] position() return incorrect left coordinate when html direction set to rtl
| Reported by: | normanzb | Owned by: | normanzb |
|---|---|---|---|
| Priority: | low | Milestone: | 1.next |
| Component: | offset | Version: | 1.5.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Repro Steps:
- extract http://qusi.org/drop/drop.node?/dropto_buggy.zip
- open demo.htm with webkit based browser (chrome 10.0.648.204)
- open javascript console.
- type: jQuery('.nested-wrapper').position()
Actual result:
the value of 'left' is always 8, no matter how wide the window is.
Expected Result:
the value of 'left' should be the distance between body/html to nested-wrapper.
How the position() in other browser behave:
Firefox: pass Safari: fail, same as chrome. IE9: pass IE8: pass
Change History
comment:1 Changed 2 years ago by addyosmani
- Owner set to normanzb
- Status changed from new to pending
comment:2 Changed 2 years ago by normanzb
- Status changed from pending to new
sorry for inconvenient,
here is the test: http://jsfiddle.net/EYLZs/
please make sure the 'result' window is larger then 400px.
comment:3 follow-ups: ↓ 5 ↓ 6 Changed 2 years ago by rwaldron
- Priority changed from undecided to low
- Resolution set to worksforme
- Status changed from new to closed
- Component changed from unfiled to offset
What you're looking for is the offset, since the position is static:
comment:4 Changed 2 years ago by normanzb
hi rwaldron,
did you tried the test with firefox? at least i see *inconsistent returning value*.
I think the value returned in firefox is correct, because in this case, the offsetParent is body/html, and offsetLeft definitely should be the distance between left edge of body/html and the left edge of wrapper.
comment:5 in reply to: ↑ 3 Changed 2 years ago by normanzb
comment:6 in reply to: ↑ 3 Changed 2 years ago by normanzb
Replying to rwaldron:
What you're looking for is the offset, since the position is static:
ping again, hi rick, for the justification pls see comment no. 4
comment:7 Changed 2 years ago by rwaldron
- Status changed from closed to reopened
- Resolution worksforme deleted
comment:8 Changed 2 years ago by rwaldron
I can confirm the inconsistent return value...
comment:10 Changed 7 months ago by mikesherov
- Status changed from open to closed
- Resolution set to worksforme
this is working on edge (and all the way back to at least 1.6.4, both results are consistent: http://gyazo.com/55b067d27f723b423a6399c1c64af701.png?1350658538 http://gyazo.com/bacd3f4281cf349605e058bb5f9bacce.png?1350658747
I suspect one of the browsers fixed a bug.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Thanks for submitting a ticket to the jQuery Project! Ideally, all tickets should be submitted with a test case on http://jsfiddle.net, however I tried downloading the zip file you linked us to and got a restricted access error. Could you kindly reproduce the code on jsFiddle so we can more easily test this?.