Bug Tracker

Ticket #8945 (closed bug: worksforme)

Opened 3 years ago

Last modified 22 months ago

[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:

  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

comment:1 Changed 3 years ago by addyosmani

  • Owner set to normanzb
  • Status changed from new to pending

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 3 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 3 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:

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

comment:4 Changed 3 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 right edge of wrapper.

Version 1, edited 3 years ago by normanzb (previous) (next) (diff)

comment:5 in reply to: ↑ 3 Changed 3 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 3 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 3 years ago by rwaldron

  • Status changed from closed to reopened
  • Resolution worksforme deleted

comment:9 Changed 3 years ago by timmywil

  • Status changed from reopened to open

comment:10 Changed 22 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.

Note: See TracTickets for help on using tickets.