Closed Bug 1338822 Opened 7 years ago Closed 5 years ago

Embed SVG: changing a 'em" value impacts "getBoundingClientRect" but not the visual size of element

Categories

(Core :: SVG, defect, P3)

48 Branch
defect

Tracking

()

RESOLVED DUPLICATE of bug 1383650

People

(Reporter: gaetan, Unassigned)

Details

(Keywords: testcase)

Attachments

(2 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:48.0) Gecko/20100101 Firefox/48.0
Build ID: 20160606004039

Steps to reproduce:

Step 1 :
<svg> <g style="font-size: 1em;">
<circle r="10em" id="circle">

Step 2 :
I change value of parent in em:
<svg> <g style="font-size: .5em;">
<circle r="10em" id="circle">



Actual results:

1) At first step, in JavaScript :
document.querySelector("#circle").getBoundingClientRect().width
-> 328

2) Result changes at second step :
document.querySelector("#circle").getBoundingClientRect().width
-> 164
BUT circle keeps visually the same


Expected results:

1) First possible expected result at second step:
document.querySelector("#circle").getBoundingClientRect().width
-> 328

2) Either circle visually reduced by half, like numeric output,
- as on Google Chrome
Keywords: testcase
Priority: -- → P3
The same problem occurs if you change the font size of the SVG. 

https://jsfiddle.net/42z1ys7j/1/
Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → WORKSFORME

Doesn't work for me!

I have the same issue and at least in Firefox 67.0.1 (64-Bit) the bug is present.

I have the same issue and at least in Firefox 67.0.1 (64-Bit) the bug is present.

Current Nightly is 69, this bug was already fixed. You can download Nightly to verify.

Actually this is a cache invalidation problem which was resolved as a by-product when implementing geometry property in Bug 1383650 (precisely, it's patch https://hg.mozilla.org/mozilla-central/rev/bda0f207ac29).

Since its resolution is a by-product, I'd still add a testcase for this to avoid regression.

Resolution: WORKSFORME → DUPLICATE

Just a reftest to avoid future regression, the actual bug was
resolved as a by-product when implementing SVG geometry property.

Pushed by violet.bugreport@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/5d650bb4c401
Add testcase for rendering sync with font-size change r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/17222 for changes under testing/web-platform/tests
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
You need to log in before you can comment on or make changes to this bug.