Bug Tracker

Opened 12 years ago

Closed 10 years ago

#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:
Blocked by: Blocking:

Description

Repro Steps:

  1. extract http://qusi.org/drop/drop.node?/dropto_buggy.zip
  2. open demo.htm with webkit based browser (chrome 10.0.648.204)
  3. open javascript console.
  4. 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 (10)

comment:1 Changed 12 years ago by addyosmani

Owner: set to normanzb
Status: newpending

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?.

comment:2 Changed 12 years ago by normanzb

Status: pendingnew

sorry for inconvenient,

here is the test: http://jsfiddle.net/EYLZs/

please make sure the 'result' window is larger then 400px.

comment:3 Changed 12 years ago by Rick Waldron

Component: unfiledoffset
Priority: undecidedlow
Resolution: worksforme
Status: newclosed

What you're looking for is the offset, since the position is static:

http://jsfiddle.net/rwaldron/rUssW/

comment:4 Changed 12 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.

Last edited 12 years ago by normanzb (previous) (diff)

comment:5 in reply to:  3 Changed 12 years ago by normanzb

Replying to rwaldron:

What you're looking for is the offset, since the position is static:

http://jsfiddle.net/rwaldron/rUssW/

## post a comment to @rwaldron to reopen the issue,

## the reason to reopen is described in comment #4

comment:6 in reply to:  3 Changed 12 years ago by normanzb

Replying to rwaldron:

What you're looking for is the offset, since the position is static:

http://jsfiddle.net/rwaldron/rUssW/

ping again, hi rick, for the justification pls see comment no. 4

comment:7 Changed 12 years ago by Rick Waldron

Resolution: worksforme
Status: closedreopened

comment:9 Changed 12 years ago by timmywil

Status: reopenedopen

comment:10 Changed 10 years ago by mikesherov

Resolution: worksforme
Status: openclosed

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.

Note: See TracTickets for help on using tickets.