WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WONTFIX
14722
REGRESSION: border is not taken in account with offsetLeft (and probally offsetTop)
https://bugs.webkit.org/show_bug.cgi?id=14722
Summary
REGRESSION: border is not taken in account with offsetLeft (and probally offs...
Sjoerd Mulder
Reported
2007-07-23 07:51:46 PDT
See attached testcase where it should set the offsetLeft value with the size of the 50px border of the parent it does not take this in account. In Safari 2.0.4 it works correctly, tested on Windows XP, Mac OSX 10.4.10 and Mac OSX 10.5
Attachments
Testcase
(883 bytes, text/html)
2007-07-23 07:53 PDT
,
Sjoerd Mulder
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Sjoerd Mulder
Comment 1
2007-07-23 07:53:21 PDT
Created
attachment 15649
[details]
Testcase
David Kilzer (:ddkilzer)
Comment 2
2007-07-23 23:04:46 PDT
(In reply to
comment #1
)
> Created an attachment (id=15649) [edit] > Testcase
So the test case passes if "border - left:78" is printed, but fails if "border - left:28" is printed? Firefox 2.0.0.5 and Safari 3.0 (522.12) + WebKit
r24534
print "border - left:28". Opera 9.21 and Safari 2.0.4 (419.3) + original WebKit print "border -left:78". What does MSIE 6/7 print?
David Kilzer (:ddkilzer)
Comment 3
2007-07-23 23:05:55 PDT
Confirming difference between Safari 2.0 and Safari 3.0 + ToT WebKit, but I'm not sure if this is a regression or not. (Assuming it is for now.)
Sjoerd Mulder
Comment 4
2007-07-24 00:53:34 PDT
I Agree that the change isnt a regression if this was intented. The problem is part of a bigger issue: measurement of layout, - IE has getBoundingClientRect() (offsetTop / offsetLeft is not reliable) - Gecko has getBoxObjectFor() (offsetTop / offsetLeft is not reliable) - Opera / Webkit have offsetTop / offsetLeft / offsetParent working reliable. In Safari 2 and Opera 9 the behavior is like expected, the 'offsetLeft' of the elements summed together is the value in pixels the element is positioned from the left side of the screen (78px). In Safari 3 this changed, sure their can be an exception added for Safari 3 but it would be quite annoying if in Safari 3.0.1. the behavior is different again,. That's why i reporting this bug as a regression, a lot of frameworks / toolkits which use 'offset' properties to measure position need to implement specific Safari 3 code
David Kilzer (:ddkilzer)
Comment 5
2007-07-24 07:09:49 PDT
(In reply to
comment #2
)
> So the test case passes if "border - left:78" is printed, but fails if "border > - left:28" is printed?
Yes, per
Comment #4
.
David Kilzer (:ddkilzer)
Comment 6
2007-07-24 07:10:56 PDT
<
rdar://problem/5356797
>
David Kilzer (:ddkilzer)
Comment 7
2007-07-24 07:36:53 PDT
Bug 13237, Comment #10
:
Comment #10
From Dave Hyatt 2007-07-24 04:08 PDT [reply] offsetLeft/Top are relative to your offsetParent. I would guess we had offsetParent wrong. The goal here is to match IE. What does IE return here?
Sjoerd Mulder
Comment 8
2007-07-24 08:56:51 PDT
I think the behavior of IE should not be matched with offsetParent / left / top. IE is complete buggy concerning to offsetParent / Left / Top (e.g. when mixing border / padding / margin / box-model / position / overflow) and though not reliable. Better would be to keep matching Safari 2.0.4 (was working fine except for TR elements but that is solved) and Opera 9.x (i remember a discussion on the Opera lists a while ago, see:
http://dump.testsuite.org/2006/dom/style/offset/spec
)
Antti Koivisto
Comment 9
2007-08-02 10:56:20 PDT
In Safari 3.0 we are matching Firefox offset behavior on purpose, see
bug 12687
. I think this should be changed now.
Antti Koivisto
Comment 10
2007-08-02 10:57:08 PDT
I meant to say that this should _not_ be changed now.
John Sullivan
Comment 11
2007-08-02 13:45:06 PDT
In Radar, Dave Hyatt agrees that this should not be changed. Setting to WONTFIX
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug