An OBJECT with exactly one of width or height given should be scaled proportionally

RESOLVED FIXED

Status

()

Core
Layout
RESOLVED FIXED
16 years ago
3 years ago

People

(Reporter: Chris Hubick, Unassigned)

Tracking

({css1, testcase})

Trunk
css1, testcase
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [Hixie-P2][CSS1-5.5.23][CSS2.1-10.6.2])

Attachments

(2 attachments, 1 obsolete attachment)

(Reporter)

Description

16 years ago
Let us assume, for example, I have a web page where I have embedded an SVG using
the Object tag.

If I do not specify width or height for an object, it should use it's natural
size if it has one, else the default [240x200 in Moz].

If I specify only the width - to be say 75%, and not the height - the object
width should be scaled to 75% of the available space, and the height should be
scaled accordingly - to maintain perspective.

Also, if you specify only one of width or height for an object using the default
size [no natural size], then the unspecified dimension should also be scaled to
maintain perspective.  Specifying a height as 1em can be taken as a hint the
author probably wouldn't want a 240px default width or vice versa.
(Reporter)

Comment 1

16 years ago
Created attachment 26849 [details]
Test case - svg with only width specified.
(Reporter)

Comment 2

16 years ago
Created attachment 26850 [details]
Embedded WAV with only width specified.
(Reporter)

Updated

16 years ago
Depends on: 70976

Comment 3

16 years ago
Confirmed
Platform: PC
OS: Linux 2.2.17
Mozilla Build: 2001030108

Marking NEW.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: testcase

Comment 4

16 years ago
Reassigning to av. 
Assignee: karnaze → av

Comment 5

16 years ago
Another object frame size issue, possiby a dup.
Assignee: av → peterlubczynski

Updated

16 years ago
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.4

Updated

16 years ago
Target Milestone: mozilla0.9.4 → mozilla0.9.5

Updated

16 years ago
Priority: -- → P5

Updated

16 years ago
Target Milestone: mozilla0.9.5 → mozilla1.0

Updated

16 years ago
Target Milestone: mozilla1.0 → mozilla0.9.9

Comment 6

16 years ago
Bugs targeted at mozilla1.0 without the mozilla1.0 keyword moved to mozilla1.0.1 
(you can query for this string to delete spam or retrieve the list of bugs I've 
moved)
Target Milestone: mozilla0.9.9 → mozilla1.0.1

Updated

16 years ago
Target Milestone: mozilla1.0.1 → mozilla0.9.9

Comment 7

16 years ago

*** This bug has been marked as a duplicate of 70976 ***
Status: ASSIGNED → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → DUPLICATE

Comment 8

16 years ago
v
Status: RESOLVED → VERIFIED

Updated

15 years ago
No longer depends on: 70976
Reopening. This affects more than plugins.
Blocks: 7954
Status: VERIFIED → REOPENED
Keywords: css1
Priority: P5 → --
QA Contact: petersen → ian
Resolution: DUPLICATE → ---
Whiteboard: [Hixie-P2]
Target Milestone: mozilla0.9.9 → ---

Comment 10

15 years ago
I suspect that the work in 70976 will cover all instances related to the object
element.

Peter: is it necessary for you to have both bugs open?
(Reporter)

Updated

15 years ago
Depends on: 70976

Comment 11

15 years ago
sounds like a dup of bug 70976 to me:
SVG can't tell the browser its "natural size" if the NPAPI doesn't support it
and hence layout has nothing to work with.

Please attach a testcase showing how this effects more than just plugins
otherwise close as dup.
(Reporter)

Comment 12

15 years ago
An object having an intrinsic size has historically been orthogonal to Mozilla
dealing with it correctly.

Mozilla exhibits different behavior depending on the type of object being
included, irregardless of whether that object has an intrinsic size.  For
example, I filed bug 69270 because image objects wouldn't size at all using
percentages, let alone maintaining perspective while doing so, and images have
always had an intrinsic size.

That is why I marked bug 70976 as blocking this, so that when someone does add
intrinsic sizing support for plugins, they will see this and also hopefully make
sure the scaling works properly - which has definitely /not/ been a given,
historically.

Updated

13 years ago
Assignee: peterlubczynski-bugs → nobody
Status: REOPENED → NEW
QA Contact: ian → core.layout

Updated

12 years ago
Summary: An OBJECT scaled using width /OR/ height should maintain perspective → An OBJECT with exactly one of width or height given should be scaled proportionally
Blocks: 321531
(Reporter)

Comment 13

11 years ago
Created attachment 218888 [details]
Page with SVG <object> specifying a % width, no height.
Attachment #26849 - Attachment is obsolete: true
(Reporter)

Comment 14

11 years ago
I believe the behavior I am asking for in this bug report is specified in section 10.6.2 of the CSS 2.1 draft at: http://www.w3.org/TR/2006/WD-CSS21-20060411/visudet.html#inline-replaced-height

Re: "block-level replaced elements in normal flow":

If 'height' has a computed value of 'auto' and 'width' has some other computed value, and the replaced element has an intrinsic ratio, ... then the used value of 'height' is: (used width) / (intrinsic ratio)".
(Reporter)

Updated

11 years ago
Depends on: 294120

Updated

10 years ago
Whiteboard: [Hixie-P2] → [Hixie-P2][CSS1-5.5.23][CSS2.1-10.6.2]
This was fixed by bug 294086. Note that the testcases may not behave quite as you expect since you are required to specify a viewBox attribute if you want them to scale.
Status: NEW → RESOLVED
Last Resolved: 16 years ago9 years ago
Depends on: 294086
No longer depends on: 70976
Resolution: --- → FIXED
(Reporter)

Comment 16

9 years ago
Absolutely fantastic!  I think with Firefox 3 it's finally nearing time to have another attempt at using SVG on some intranet sites (bug 231179 now being the only major remaining caveat for me)!

Thanks to you and all the Mozilla devs for your hard work! :)
You're welcome. Have fun. :)

Hopefully we'll get that SVG "as an image" thing in the next release!
Flags: in-testsuite?
Tons of reftests were added as part of bug 294086. For the issue covered by this bug in particular see the object--* tests in:

http://lxr.mozilla.org/seamonkey/source/layout/reftests/svg/sizing/
Flags: in-testsuite? → in-testsuite+
You need to log in before you can comment on or make changes to this bug.