[CSS21] 8.4: "negative padding" meaning with percentages

  # Unlike margin properties, values for padding values cannot be negative.
  # Like margin properties, percentage values for padding properties refer
  # to the width of the generated box's containing block.

In the case that the containing block's width is negative, it isn't clear
whether this means that percentages aren't allowed to be negative (i.e.
whether a negative percentage is considered an illegal value regardless
of whether or not the containing block width is positive), or the used
value isn't allowed to be negative, or both.

If the used value isn't allowed to be negative, then there needs to be
some text saying what to do if the percentage calculation does give a
negative answer (as might happen even if the percentage is a positive
percentage if the containing block width is negative), for example
stating that the used value is zero in this case (similar to 'min-width'
and 'max-width').

(My best reading of the existing text is that it should be treated as
 an illegal value if the percentage calculation result is negative,
 though this would be unfortunate, as it means that the cascade
 resolution needs knowledge of the width of the containing block
 to know which declarations should be discarded as illegal and thus
 know to retain other declarations.)

(Update: I've now tested a few user agents, but none had particularly
 reasonable/consistent/conforming behaviour for the one case I'm aware of
 that can give a negative containing block width.  See post entitled
 "[CSS21] negative containing block width and percentages".)


'min-width' and 'max-width' (§10.4) have a similar issue in that
the text says

  # Negative values for 'min-width' and 'max-width' are illegal.

but isn't completely clear whether negative percentages are illegal.
If they are to be considered illegal, then I would suggest explicitly
adding "(including negative percentage values)".


pjrm.

Received on Wednesday, 3 November 2010 06:47:11 UTC