WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED INVALID
15539
border is not taken in account with offsetLeft/Top in border-box mode
https://bugs.webkit.org/show_bug.cgi?id=15539
Summary
border is not taken in account with offsetLeft/Top in border-box mode
Marcus Better
Reported
2007-10-17 05:29:54 PDT
Bug #14722
notes that WebKit does not include the border of the offsetParent in the offsetLeft/Top values for an element, in order to imitate Mozilla's behaviour. However there is one case where Mozilla does include the border (and WebKit doesn't), and that is when the parent element has -moz-box-sizing border-box. WebKit should do this too if it wants to follow Mozilla.
Attachments
Test case
(2.15 KB, text/html)
2007-10-17 05:32 PDT
,
Marcus Better
no flags
Details
The result on Firefox 2.0.0.7
(26.25 KB, image/png)
2007-10-17 05:34 PDT
,
Marcus Better
no flags
Details
The result on WebKit r26570
(54.04 KB, image/png)
2007-10-17 05:38 PDT
,
Marcus Better
no flags
Details
Corrected test case
(2.15 KB, text/html)
2007-10-17 07:09 PDT
,
Marcus Better
no flags
Details
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Marcus Better
Comment 1
2007-10-17 05:32:31 PDT
Created
attachment 16699
[details]
Test case The test case checks the offsetLeft/Top of a div whose parent has box-sizing set to border-box.
Marcus Better
Comment 2
2007-10-17 05:34:33 PDT
Created
attachment 16700
[details]
The result on Firefox 2.0.0.7 This shows that the border of div1 is included in offsetLeft/Top.
Marcus Better
Comment 3
2007-10-17 05:38:15 PDT
Created
attachment 16701
[details]
The result on WebKit
r26570
This shows that WebKit does not include the border of div1 in the offsetLeft/Top.
Marcus Better
Comment 4
2007-10-17 07:09:13 PDT
Created
attachment 16705
[details]
Corrected test case There was a minor bug in the test case that doesn't affect the results.
Dave Hyatt
Comment 5
2007-10-17 11:47:30 PDT
I see no reason why box-sizing should affect the values returned by offsetLeft/Top. This sounds like a bug in Mozilla to me.
Marcus Better
Comment 6
2007-10-18 01:02:58 PDT
(In reply to
comment #5
)
> I see no reason why box-sizing should affect the values returned by > offsetLeft/Top. This sounds like a bug in Mozilla to me.
Could be. Internet Explorer 7 behaves like WebKit here. I'll see if I can find more information.
Marcus Better
Comment 7
2007-10-18 02:38:44 PDT
Filed a bug for Mozilla:
https://bugzilla.mozilla.org/show_bug.cgi?id=400258
Martin Robinson
Comment 8
2021-09-09 07:06:37 PDT
The behavior in Firefox, Chromium, and WebKit all match now. The Gecko bug was fixed. I think we can close this.
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