Closed Bug 1867409 Opened 2 years ago Closed 20 hours ago

Object does not adjust its size to the SVG data it currently refers to.

Categories

(Core :: SVG, defect, P3)

Firefox 119
defect

Tracking

()

RESOLVED FIXED
141 Branch
Tracking Status
firefox141 --- fixed

People

(Reporter: fuchsiahoney, Assigned: longsonr)

Details

Attachments

(7 files, 3 obsolete files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/119.0

Steps to reproduce:

In an HTML file, an object element can refer to a SVG file like this:

<object data="small.svg"></object>

with small.svg being:

<svg xmlns="http://www.w3.org/2000/svg" width="160" height="120">
<a href="large.svg">
<image href="small.jpg"/>
</a>
</svg>

and large.svg being:

<svg xmlns="http://www.w3.org/2000/svg" width="800" height="600">
<a href="small.svg">
<image href="large.jpg"/>
</a>
</svg>

Actual results:

The object element initially takes on the size of small.svg correctly, 160x120. Upon clicking the link in small.svg, the object grows to 300x150, and remains at that size even after clicking the link in large.svg

Expected results:

The object should initially be 160x120, grow to the size of large.svg, 800x600, after clicking the link in small.svg, and shrink to the size of small.svg, its initial size, after clicking the link in large.svg

The Bugbug bot thinks this bug should belong to the 'Core::SVG' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → SVG
Product: Firefox → Core

If a border is added to the object, and the inner link is clicked over and over again quickly, the border alone will sometimes be the correct size for an instant, before being shrunken to 300x150.

Attached file test.html
Attached image small.jpg
Attached image large.jpg
Attached image small.svg (obsolete) —
Attached image large.svg (obsolete) —
Attached image large.svg
Attachment #9366220 - Attachment is obsolete: true
Attached image small.svg (obsolete) —
Attachment #9366219 - Attachment is obsolete: true
Attached image small.svg
Attachment #9366239 - Attachment is obsolete: true
Attachment #9366241 - Attachment mime type: text/plain → text/html

Seems to be a race between the new frame creation and the old frame destruction. The new frame creation happens first and then the old frame destruction sets the size back to the default.

Old frame destruction doesn't happen till nsDocumentViewer::Show when the previous document viewer is destroyed.

Assignee: nobody → longsonr
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

The severity field is not set for this bug.
:tlouw, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(tlouw)
Severity: -- → S3
Flags: needinfo?(tlouw)
Priority: -- → P3
Pushed by longsonr@gmail.com: https://github.com/mozilla-firefox/firefox/commit/da3ff672d8b2 https://hg.mozilla.org/integration/autoland/rev/cf8394609309 Delay notifying our new frame size to the embedder until after the old frame has completed its destruction r=emilio
Pushed by sstanca@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/82e297ebe697 https://hg.mozilla.org/integration/autoland/rev/57b12324193d Revert "Bug 1867409 - Delay notifying our new frame size to the embedder until after the old frame has completed its destruction r=emilio" as requested by longsonr because it requires a reland with some adjustements.

Reverted this as requested by longsonr because it requires a reland with some adjustements.

Flags: needinfo?(longsonr)
Pushed by longsonr@gmail.com: https://github.com/mozilla-firefox/firefox/commit/a3e20adb2a1d https://hg.mozilla.org/integration/autoland/rev/1a64b46759a1 Delay notifying our new frame size to the embedder until after the old frame has completed its destruction r=emilio
Status: ASSIGNED → RESOLVED
Closed: 20 hours ago
Resolution: --- → FIXED
Target Milestone: --- → 141 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: