offsetLeft includes borders when box-sizing is border-box

UNCONFIRMED
Unassigned

Status

()

Core
Layout: Block and Inline
UNCONFIRMED
11 years ago
11 years ago

People

(Reporter: Marcus Better, Unassigned)

Tracking

1.8 Branch
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

11 years ago
User-Agent:       Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.7 (like Gecko) (Debian)
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20070723 Iceweasel/2.0.0.6

The offsetParent's border is usually not included in the offsetLeft value. However if the parent's -moz-box-sizing is "border-box", then the border _is_ included.

This is contrary to how MSIE 7 and WebKit behave (see http://bugs.webkit.org/show_bug.cgi?id=15539).

Reproducible: Always
(Reporter)

Updated

11 years ago
Version: unspecified → 1.8 Branch
(Reporter)

Comment 1

11 years ago
Created attachment 285335 [details]
Test case

This shows the values that are included in the offsetLeft of the div2 element. The box turns red if the test fails. Expected results are 384,384 (div2 margin plus div2 top/left).

(Note that the bug equally affects offsetTop.)
(Reporter)

Comment 2

11 years ago
Created attachment 285336 [details]
Test result for Firefox 2.0.0.6.
You need to log in before you can comment on or make changes to this bug.