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)

x86
Windows XP
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.
Attached file HTML and js files (obsolete) —
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.
Keywords: testcase
Product: Firefox → Core
QA Contact: general → general
Version: unspecified → Trunk
Attached file test case 1
Attached file test case 2
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.
Yeah, thanks for the updated testcase.
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.
Attached file test case 3 (obsolete) —
@Boris: Can you explain test case 3?
Comment on attachment 242459 [details] test case 3 Sorry!
Attachment #242459 - Attachment is obsolete: true
I have no idea what testcase 3 is testing, so no.
Attached file test case 4
uptodate test case 3
Severity: normal → S3

"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.

Attachment

General

Creator:
Created:
Updated:
Size: