getBoundingClientRect does not give where the element is located.

RESOLVED FIXED

Status

()

Core
SVG
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: jack ping hua zhan, Unassigned)

Tracking

32 Branch
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Reporter)

Description

3 years ago
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?

Updated

3 years ago
Component: Untriaged → SVG
Product: Firefox → Core
Please add a complete testcase to the bug as an attachment.
Flags: needinfo?(jackiszhp)
(Reporter)

Comment 2

3 years ago
Created attachment 8496607 [details]
to show I am not able to get the position of the SVG element.

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)
(Reporter)

Updated

3 years ago
Attachment #8496607 - Attachment is obsolete: true
(Reporter)

Comment 3

3 years ago
Created attachment 8496609 [details]
to show I am not able to get the position of the SVG element.

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?
(Reporter)

Updated

3 years ago
Attachment #8496609 - Attachment is obsolete: true
(Reporter)

Comment 4

3 years ago
Created attachment 8496611 [details]
to show I am not able to get the position of the SVG element.

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
Last Resolved: 3 years ago
Depends on: 530985
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.