Re: 300x150 px defaults too aggressive

Bjoern Hoehrmann wrote:
> * Jonathan Watt wrote:
>> While working on the replaced element code for Mozilla I've come across some
>> cases where the behavior currently mandated by the CSS 2.1 text is
>> counterintuitive, and unnecessarily so. Please consider the following case
>> (contrived for simplicity), where the ’width’ and ’height’ attributes provide
>> the intrinsic width and height:
>>   <svg style="width:100%;" width="100%" height="100px"/>
>> Since the intrinsic and specified widths are both 100%, and the intrinsic height 
>> is 100px, one might reasonably expect the replaced element to have a used width 
>> of 100% and a used height of 100px. However, the current CSS 2.1 text says the 
>> used height must be 150px. (Note the SVG in this example has no intrinsic ratio 
>> because the ’width’ attribute has a percentage value.)
> Is there some up to date description that defines the various intrinsic
> properties of the SVG document? For example, per section 6.17 of SVG 1.1
> I would arrive at a different conclusion than you do above,

> and last I
> checked there were disputes whether percentage widths / heights can ever
> contribute to intrinsic heights / widths / ratios,

That's an orthogonal discussion that isn't relevant to the cases I'm concerned 
with as far as I can see.

> not to mention that
> the effect of SVG view specifications on this has yet to be defined, see
> e.g. and
> follow-ups (member-only).
> I think before the CSS Working Group can consider changes to the text in
> CSS 2.1, we need to have a clear and complete description of the SVG
> side of the issue, so we can properly evaluate the impact of any change
> (which will be hard enough with multiple accumulated change proposals).

Although it's SVG that has brought this to my attention, I don't think this is 
necessarily an SVG issue. It's simply an issue of the CSS spec covering the 
cases where replaced elements have only _one_ of intrinsic width or intrinsic 
height, and no intrinsic ratio - a case that doesn't seem to have been considered.

> That aside, could you give some real world example where you'd write the
> code above?

The less contrived case would be when the SVG is embedded by reference and the 
CSS is on the embedding element (e.g. HTML <object>).


Received on Monday, 17 September 2007 10:51:55 UTC