You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Manuel Mall <mm...@arcus.com.au> on 2005/09/07 08:19:05 UTC

Combined compound and shorthand property specs

Is the following legal:?

<fo:inline
  border="solid 1pt red"
  border-start-width.conditionality="retain" 
  border-end-width.conditionality="retain" 
  padding="1pt"
  padding-start.conditionality="retain" 
  padding-end.conditionality="retain">

What seems to happen is that for borders it works fine, that is I get 4
solid red 1pt borders with the start and end borders having a conditionality
of "retain". However for padding I get padding before and after with length
1pt but start and end padding have a length of 0pt(!) although their
conditionality is correctly set to "retain".

If the above is legal than something is wrong in the property subsystem with
respect to shorthand length and component specs. If the above is illegal
than I am just lucky that it works for borders.

Manuel

Re: Combined compound and shorthand property specs

Posted by Manuel Mall <mm...@arcus.com.au>.
On Wed, 7 Sep 2005 11:19 pm, Finn Bock wrote:
> [Manuel]
>
> >><fo:inline
> >>   border="solid 1pt red"
> >>   border-left-width.conditionality="retain"
> >>   border-right-width.conditionality="retain"
> >>   padding="1pt"
> >>   padding-left.conditionality="retain"
> >>   padding-right.conditionality="retain">
> >
> > I must still be misunderstanding something. The above property
> > definition does not give the results I expected. All 4 of
> > border/padding start/end still have conditionality="discard".
>
> The absolute border-*-width & padding-* are length, not
> length-conditional. So the default values for .conditionality is
> returned.
>
> OTOH, setting a component like .conditionality on a length should
> definitely cause an error or warning.

Thanks Finn, this spec is a treasure trove of quirks and mysteries. Why 
is xxx-left/right a length and xxx-start/end a length conditional? I 
assume it has to do with CSS backwards compatibility? Any way this 
means there is no way to set borders/padding using a shorthand and then 
overwriting the conditionality. Not to worry - I certainly learned just 
a little bit more today.

>
> regards,
> finn

regards
Manuel

Re: Combined compound and shorthand property specs

Posted by Finn Bock <bc...@worldonline.dk>.
[Manuel]

>><fo:inline
>>   border="solid 1pt red"
>>   border-left-width.conditionality="retain"
>>   border-right-width.conditionality="retain"
>>   padding="1pt"
>>   padding-left.conditionality="retain"
>>   padding-right.conditionality="retain">
>>
> 
> I must still be misunderstanding something. The above property 
> definition does not give the results I expected. All 4 of 
> border/padding start/end still have conditionality="discard".

The absolute border-*-width & padding-* are length, not 
length-conditional. So the default values for .conditionality is returned.

OTOH, setting a component like .conditionality on a length should 
definitely cause an error or warning.

regards,
finn

Re: Combined compound and shorthand property specs

Posted by Manuel Mall <mm...@arcus.com.au>.
On Wed, 7 Sep 2005 04:11 pm, Manuel Mall wrote:
> On Wed, 7 Sep 2005 03:48 pm, Finn Bock wrote:
> > [Manuel]
<snip/>
> >
> >  From [5.3.1]
> >
> > """
> > If the corresponding relative property is specified on the
> > formatting object and the absolute property only specified by the
> > expansion of a shorthand, then the computed value of the absolute
> > property is set to the computed value of the corresponding relative
> > property. """
> >
> > I don't know if that is the correct interpretation.
>
> Finn,
>
> thank you - forgot that the shorthands set the absolute and not the
> relative properties. So this should work?:
>
> <fo:inline
>    border="solid 1pt red"
>    border-left-width.conditionality="retain"
>    border-right-width.conditionality="retain"
>    padding="1pt"
>    padding-left.conditionality="retain"
>    padding-right.conditionality="retain">
>

I must still be misunderstanding something. The above property 
definition does not give the results I expected. All 4 of 
border/padding start/end still have conditionality="discard".

> > regards,
> > finn
>
> Manuel

Manuel

Re: Combined compound and shorthand property specs

Posted by Manuel Mall <mm...@arcus.com.au>.
On Wed, 7 Sep 2005 03:48 pm, Finn Bock wrote:
> [Manuel]
>
> > Is the following legal:?
> >
> > <fo:inline
> >   border="solid 1pt red"
> >   border-start-width.conditionality="retain"
> >   border-end-width.conditionality="retain"
> >   padding="1pt"
> >   padding-start.conditionality="retain"
> >   padding-end.conditionality="retain">
> >
> > What seems to happen is that for borders it works fine, that is I
> > get 4 solid red 1pt borders with the start and end borders having a
> > conditionality of "retain".
>
> Oh, it works exactly the same for borders, you are just seeing the
> default "medium" (=1pt) value for "border-start-with.length" and the
> default "0pt" for "padding-start.length".
>
> > However for padding I get padding before and after with length
> > 1pt but start and end padding have a length of 0pt(!) although
> > their conditionality is correctly set to "retain".
> >
> > If the above is legal than something is wrong in the property
> > subsystem with respect to shorthand length and component specs. If
> > the above is illegal than I am just lucky that it works for
> > borders.
>
> The effect seen occurs because we consider "padding-start" to be
> explicitly set by setting "padding-start.conditionality" and then the
> shorthand is ignored.
>
>  From [5.3.1]
>
> """
> If the corresponding relative property is specified on the formatting
> object and the absolute property only specified by the expansion of a
> shorthand, then the computed value of the absolute property is set to
> the computed value of the corresponding relative property.
> """
>
> I don't know if that is the correct interpretation.
>
Finn,

thank you - forgot that the shorthands set the absolute and not the 
relative properties. So this should work?:

<fo:inline
   border="solid 1pt red"
   border-left-width.conditionality="retain"
   border-right-width.conditionality="retain"
   padding="1pt"
   padding-left.conditionality="retain"
   padding-right.conditionality="retain">

> regards,
> finn

Manuel

Re: Combined compound and shorthand property specs

Posted by Finn Bock <bc...@worldonline.dk>.
[Manuel]

> Is the following legal:?
> 
> <fo:inline
>   border="solid 1pt red"
>   border-start-width.conditionality="retain" 
>   border-end-width.conditionality="retain" 
>   padding="1pt"
>   padding-start.conditionality="retain" 
>   padding-end.conditionality="retain">
> 
> What seems to happen is that for borders it works fine, that is I get 4
> solid red 1pt borders with the start and end borders having a conditionality
> of "retain". 

Oh, it works exactly the same for borders, you are just seeing the 
default "medium" (=1pt) value for "border-start-with.length" and the 
default "0pt" for "padding-start.length".

> However for padding I get padding before and after with length
> 1pt but start and end padding have a length of 0pt(!) although their
> conditionality is correctly set to "retain".
> 
> If the above is legal than something is wrong in the property subsystem with
> respect to shorthand length and component specs. If the above is illegal
> than I am just lucky that it works for borders.

The effect seen occurs because we consider "padding-start" to be 
explicitly set by setting "padding-start.conditionality" and then the 
shorthand is ignored.

 From [5.3.1]

"""
If the corresponding relative property is specified on the formatting 
object and the absolute property only specified by the expansion of a 
shorthand, then the computed value of the absolute property is set to 
the computed value of the corresponding relative property.
"""

I don't know if that is the correct interpretation.

regards,
finn