Closed Bug 1073909 Opened 10 years ago Closed 10 years ago

getBoundingClientRect does not give where the element is located.

Categories

(Core :: SVG, defect)

32 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jackiszhp, Unassigned)

References

Details

Attachments

(1 file, 2 obsolete files)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0
Build ID: 20140924083558

Steps to reproduce:


>var e=document.getElementById('svgID1');
>e //show e
<svg id="svgID1" width="300px" height="300px" version="1.1px" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg" viewBox="44800 266.5 300 300">
>e.getBoundingClientRect();  //show the rectangle




Actual results:

DOMRect { x=-44792.5, y=-202, width=44951, more...}





Expected results:

Here, we can see that x is -44792.5, I thought it should be where the svg element is located. If it is in fact not the right way to get where the element is located, then what is the right way?
Component: Untriaged → SVG
Product: Firefox → Core
Please add a complete testcase to the bug as an attachment.
Flags: needinfo?(jackiszhp)
To show that I am not able to get the position of an SVG element as the position of other html elements.
Flags: needinfo?(jackiszhp)
Attachment #8496607 - Attachment is obsolete: true
To show I am not able to get the position information of the SVG element, as I can do for all other html elements.

If the kind of results is right for a svg element, then how do I get the position information as I usually do for other html elements?
Attachment #8496609 - Attachment is obsolete: true
To show that I am not able to get the position information for the SVG element as I do so for other html elements.

If this result is right, then how do I get the position information for the SVG element?
This was fixed in Firefox 33.
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Depends on: 530985
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: