Last Comment Bug 70978 - An OBJECT with exactly one of width or height given should be scaled proportionally
: An OBJECT with exactly one of width or height given should be scaled proporti...
Status: RESOLVED FIXED
[Hixie-P2][CSS1-5.5.23][CSS2.1-10.6.2]
: css1, testcase
Product: Core
Classification: Components
Component: Layout (show other bugs)
: Trunk
: All All
: -- normal with 6 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
Depends on: 294086 294120
Blocks: html4.01 321531
  Show dependency treegraph
 
Reported: 2001-03-05 19:38 PST by Chris Hubick
Modified: 2014-04-26 02:21 PDT (History)
16 users (show)
jwatt: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Test case - svg with only width specified. (267 bytes, text/html)
2001-03-05 19:39 PST, Chris Hubick
no flags Details
Embedded WAV with only width specified. (244 bytes, text/html)
2001-03-05 19:40 PST, Chris Hubick
no flags Details
Page with SVG <object> specifying a % width, no height. (1.66 KB, text/html)
2006-04-18 14:45 PDT, Chris Hubick
no flags Details

Description Chris Hubick 2001-03-05 19:38:42 PST
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.
Comment 1 Chris Hubick 2001-03-05 19:39:39 PST
Created attachment 26849 [details]
Test case - svg with only width specified.
Comment 2 Chris Hubick 2001-03-05 19:40:53 PST
Created attachment 26850 [details]
Embedded WAV with only width specified.
Comment 3 Keyser Sose 2001-03-05 22:52:54 PST
Confirmed
Platform: PC
OS: Linux 2.2.17
Mozilla Build: 2001030108

Marking NEW.
Comment 4 karnaze (gone) 2001-03-07 15:07:43 PST
Reassigning to av. 
Comment 5 Peter Lubczynski 2001-05-02 12:41:36 PDT
Another object frame size issue, possiby a dup.
Comment 6 Asa Dotzler [:asa] 2001-12-03 10:30:32 PST
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)
Comment 7 Peter Lubczynski 2002-02-12 11:21:26 PST

*** This bug has been marked as a duplicate of 70976 ***
Comment 8 shrirang khanzode 2002-02-12 13:25:03 PST
v
Comment 9 Hixie (not reading bugmail) 2002-11-18 23:41:04 PST
Reopening. This affects more than plugins.
Comment 10 rubydoo123 2002-11-20 13:33:53 PST
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?
Comment 11 Peter Lubczynski 2002-11-20 14:19:55 PST
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.
Comment 12 Chris Hubick 2002-11-20 16:05:41 PST
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.
Comment 13 Chris Hubick 2006-04-18 14:45:26 PDT
Created attachment 218888 [details]
Page with SVG <object> specifying a % width, no height.
Comment 14 Chris Hubick 2006-05-03 14:34:45 PDT
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)".
Comment 15 Jonathan Watt [:jwatt] (Away Jun. 27 - Jul. 13) 2008-03-12 23:55:28 PDT
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.
Comment 16 Chris Hubick 2008-03-13 00:19:45 PDT
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! :)
Comment 17 Jonathan Watt [:jwatt] (Away Jun. 27 - Jul. 13) 2008-03-13 00:34:35 PDT
You're welcome. Have fun. :)

Hopefully we'll get that SVG "as an image" thing in the next release!
Comment 18 Jonathan Watt [:jwatt] (Away Jun. 27 - Jul. 13) 2008-03-13 06:47:49 PDT
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/

Note You need to log in before you can comment on or make changes to this bug.