Closed
Bug 356066
Opened 19 years ago
Closed 1 year ago
nsIBoxObject get from document.getBoxObjectFor(element) has wrong location(x,y)
Categories
(Core :: General, defect)
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: topperlu, Unassigned)
Details
(Keywords: testcase)
Attachments
(3 files, 2 obsolete files)
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-TW; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-TW; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7
Javascript: var bo = document.getBoxObjectFor(element);
Values of bo.x and bo.y are wrong.
Case 1: HTMLHtmlElement do not has margin or border
If element has border width, then the values of (bo.x,bo.y) is the position (x,y) plus extra border widths.
Case 2: HTMLHtmlElement do has margin or border
The values of (bo.x,bo.y) is the position (x,y) plus extra border widths and margins of HTMLHtmlElement.
Reproducible: Always
Steps to Reproduce:
1.Create a div element with border.
2.Use javascript: var bo = document.getBoxObjectFor(element);
3.Check bo.x and bo.y
Actual Results:
The values of bo.x and bo.y are wrong.
Comment 2•19 years ago
|
||
Thanks for the report.
Could you elaborate what exactly is wrong please (i.e. expected: values calculated in <such> way; actual results: values are miscalulated <so>)? It's not immediately obvious from your description of the bug or the testcase.
Also, for future reference, single-page testcases (e.g. HTML with inline CSS+JS) are preferred to zip attachments.
Attachment #241752 -
Attachment is obsolete: true
case1:
This bug will make all elements with border have wrong offsetLeft, offsetTop values.
case 2:
This bug will make all elements have wrong offsetLeft, offsetTop values, if HTMLHtmlElement has margin or border.
Comment 6•19 years ago
|
||
Yeah, thanks for the updated testcase.
Comment 7•19 years ago
|
||
offset* does not use nsIBoxObject. The two are completely unrelated. So comment 5 is wrong.
What boxObject _should_ do is not very well defined, in fact. So no point in working on this till we decide that.
Comment on attachment 242459 [details]
test case 3
Sorry!
Attachment #242459 -
Attachment is obsolete: true
Comment 10•19 years ago
|
||
I have no idea what testcase 3 is testing, so no.
| Reporter | ||
Comment 11•19 years ago
|
||
uptodate test case 3
Updated•3 years ago
|
Severity: normal → S3
Comment 12•1 year ago
|
||
"The non-standard getBoxObjectFor() DOM method has been removed. You should be using getBoundingClientRect() instead." quoted in https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/3.5
Status: UNCONFIRMED → RESOLVED
Closed: 1 year ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•