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 "Peter B. West" <pb...@powerup.com.au> on 2002/08/24 10:37:41 UTC
Compound property inheritance
Devs,
I've raised this question before, but I am still uncomfortable with
compound inheritance, so I will try again for a developer consensus.
5.11 Property Datatypes has:
"Compound values of properties are inherited as a unit and not as
individual components. After inheritance any complete form specification
for a component is used to set its value."
Let's assume, for the purpose of the discussion, that "space-before" is
inheritable. According to 5.11,
<quote>
space-before="4.0pt"
is equivalent to a specification of
space-before.minimum="4.0pt"
space-before.optimum="4.0pt"
space-before.maximum="4.0pt"
space-before.precedence="0"
space-before.conditionality="discard"
</quote>
and
<quote>
Short forms may be used together with complete forms; the complete forms
have precedence over the expansion of a short form. For example:
space-before="4.0pt"
space-before.maximum="6.0pt"
is equivalent to a specification of
space-before.minimum="4.0pt"
space-before.optimum="4.0pt"
space-before.maximum="6.0pt"
space-before.precedence="0"
space-before.conditionality="discard"
</quote>
At this point, what is the inherited value of space-before? If the idea
of a compound is that the value of the compound is the sum of its parts,
then "inherited as a unit" would mean
space-before.minimum="4.0pt"
space-before.optimum="4.0pt"
space-before.maximum="6.0pt"
space-before.precedence="0"
space-before.conditionality="discard"
However, isn't that exactly the same as the inheritance of individual
components, which we are specifically told doesn't happen? For
shorthands, the inheritance is NOT of the shorthand but of the
individual components, which allows that some components of the
shorthand not be inherited, while others are. Is this the significance
of the "as a unit"; that either all of the individual components are
inherited or none are?
Or does "inherited as a unit and not as individual components" mean that
the unitary assignment and its consequences
space-before="4.0pt"
is inherited, and not the assignments to the individual components
space-before.maximum="6.0pt"
?
The latter would mean that an individual, different, length component
value could never be inherited, but would always have to be specified.
This doesn't make much sense, but then, if the first interpretation is
correct, neither does the "not as individual components." I bounce back
and forth between these two readings. When I am leaning to the former,
I am influenced by the desire of compounds to masquerade as single
properties for CSS compatibility.
What say you?
Peter
--
Peter B. West pbwest@powerup.com.au http://www.powerup.com.au/~pbwest/
"Lord, to whom shall we go?"
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org
Re: Compound property inheritance
Posted by Karen Lease <kl...@club-internet.fr>.
Peter B. West wrote:
> Karen Lease wrote:
>
>>
>> I wasn't very clear. What I meant was this:
>> if the short form is specified on an FO, it is used to set all the
>> <length> values and the other components are set to their initial
>> values. Then if any complete forms are specified, they overwrite the
>> values from the short form. So far so good (we all seem to agree that
>> this conforms to the specification). But if _only_ complete forms are
>> present for a given FO, all components are first set to the initial
>> values (and not to the inherited values, even for inheritable
>> properties) and then the specified values for any complete forms
>> override those. I'm not saying it's right (we all seem to agree that
>> it isn't in fact); just clarifying the current behavior.
>
>
> Ok Karen; I'm sorry for jumping to the wrong conclusion. Arved, do you
> think that the behaviour described is wrong? If so, do you think that
> the correct behaviour a) in the case of an inherited compound with no
> short form assignment would be to inherit the computed values of all
> components from the parent, and b) in the case of an inherited compound
> with no short form assignment, but with a single component assignment,
> would be to set the component from the assignment and to inherit from
> the parent the computed values of all other components? Karen, is that
> how you read it?
>
> Peter
Yes, on both points.
-KL
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org
RE: Compound property inheritance
Posted by Arved Sandstrom <Ar...@chebucto.ns.ca>.
> -----Original Message-----
> From: Peter B. West [mailto:pbwest@powerup.com.au]
> Sent: August 26, 2002 8:09 PM
> To: fop-dev@xml.apache.org
> Subject: Re: Compound property inheritance
>
> Karen Lease wrote:
> >
> > I wasn't very clear. What I meant was this:
> > if the short form is specified on an FO, it is used to set all the
> > <length> values and the other components are set to their initial
> > values. Then if any complete forms are specified, they overwrite the
> > values from the short form. So far so good (we all seem to agree that
> > this conforms to the specification). But if _only_ complete forms are
> > present for a given FO, all components are first set to the initial
> > values (and not to the inherited values, even for inheritable
> > properties) and then the specified values for any complete forms
> > override those. I'm not saying it's right (we all seem to agree that it
> > isn't in fact); just clarifying the current behavior.
>
> Ok Karen; I'm sorry for jumping to the wrong conclusion. Arved, do you
> think that the behaviour described is wrong? If so, do you think that
> the correct behaviour a) in the case of an inherited compound with no
> short form assignment would be to inherit the computed values of all
> components from the parent, and b) in the case of an inherited compound
> with no short form assignment, but with a single component assignment,
> would be to set the component from the assignment and to inherit from
> the parent the computed values of all other components? Karen, is that
> how you read it?
I understand a) and b) just as you have described it.
I read the spec to say that a complete form sets the specified component,
period, with no side-effects (like resetting other components). Let's recap,
from the spec:
1. short-form - "Such a specification gives that value to each of the
<length> components and the initial value to all the non-<length>
components."
2. "Short forms may be used together with complete forms; the complete forms
have precedence over the expansion of a short form."
3. "Compound values of properties are inherited as a unit and not as
individual components."
4. "After inheritance any complete form specification for a component is
used to set its value."
I think these 4 statements combine to give a clear picture of what happens.
For example, statement 4 definitively indicates that b) is exactly what
occurs.
Arved
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org
Re: Compound property inheritance
Posted by "Peter B. West" <pb...@powerup.com.au>.
Karen Lease wrote:
>
> I wasn't very clear. What I meant was this:
> if the short form is specified on an FO, it is used to set all the
> <length> values and the other components are set to their initial
> values. Then if any complete forms are specified, they overwrite the
> values from the short form. So far so good (we all seem to agree that
> this conforms to the specification). But if _only_ complete forms are
> present for a given FO, all components are first set to the initial
> values (and not to the inherited values, even for inheritable
> properties) and then the specified values for any complete forms
> override those. I'm not saying it's right (we all seem to agree that it
> isn't in fact); just clarifying the current behavior.
Ok Karen; I'm sorry for jumping to the wrong conclusion. Arved, do you
think that the behaviour described is wrong? If so, do you think that
the correct behaviour a) in the case of an inherited compound with no
short form assignment would be to inherit the computed values of all
components from the parent, and b) in the case of an inherited compound
with no short form assignment, but with a single component assignment,
would be to set the component from the assignment and to inherit from
the parent the computed values of all other components? Karen, is that
how you read it?
Peter
--
Peter B. West pbwest@powerup.com.au http://www.powerup.com.au/~pbwest/
"Lord, to whom shall we go?"
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org
Re: Compound property inheritance
Posted by Karen Lease <kl...@club-internet.fr>.
Peter B. West wrote:
> Karen Lease wrote:
<snip/>
>
>> If I recall correctly, the current FOP functionality will only use the
>> inherited value if neither a short form nor any complete component
>> form is specified on a particular FO. As soon as either a short form
>> or a complete form is used, the remaining components are filled in
>> from the initial values.
>
>
> The last sentence I don't follow. Why should the setting of an
> individual value, through a complete form, trigger the a reset of all
> other component values? In this case -
> space-before="4.0pt"
> space-before.maximum="6.0pt"
> - it doesn't. I fear you have a way of looking at this which eludes me.
I wasn't very clear. What I meant was this:
if the short form is specified on an FO, it is used to set all the
<length> values and the other components are set to their initial
values. Then if any complete forms are specified, they overwrite the
values from the short form. So far so good (we all seem to agree that
this conforms to the specification). But if _only_ complete forms are
present for a given FO, all components are first set to the initial
values (and not to the inherited values, even for inheritable
properties) and then the specified values for any complete forms
override those. I'm not saying it's right (we all seem to agree that it
isn't in fact); just clarifying the current behavior.
Karen
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org
Re: Compound property inheritance
Posted by "Peter B. West" <pb...@powerup.com.au>.
Karen Lease wrote:
> Hi Peter,
>
> These things will tie your brain in knots...
>
> Peter B. West wrote:
>
> > 5.11 Property Datatypes has:
> >
> > "Compound values of properties are inherited as a unit and not as
> > individual components. After inheritance any complete form specification
> > for a component is used to set its value."
> >
> > Let's assume, for the purpose of the discussion, that "space-before" is
> > inheritable. According to 5.11,
> >
> > <quote>
> > space-before="4.0pt"
> >
> > is equivalent to a specification of
> >
> > space-before.minimum="4.0pt"
> > space-before.optimum="4.0pt"
> > space-before.maximum="4.0pt"
> > space-before.precedence="0"
> > space-before.conditionality="discard"
> > </quote>
> >
> > and
> >
> > <quote>
> > Short forms may be used together with complete forms; the complete forms
> > have precedence over the expansion of a short form. For example:
> >
> > space-before="4.0pt"
> > space-before.maximum="6.0pt"
> >
> > is equivalent to a specification of
> >
> > space-before.minimum="4.0pt"
> > space-before.optimum="4.0pt"
> > space-before.maximum="6.0pt"
> > space-before.precedence="0"
> > space-before.conditionality="discard"
> > </quote>
> >
> > At this point, what is the inherited value of space-before? If the idea
> > of a compound is that the value of the compound is the sum of its parts,
> > then "inherited as a unit" would mean
> >
> > space-before.minimum="4.0pt"
> > space-before.optimum="4.0pt"
> > space-before.maximum="6.0pt"
> > space-before.precedence="0"
> > space-before.conditionality="discard"
>
>
> That's what I think it means.
>
OK. I'm happy to go with that, and Arved hasn't commented on this
point, so I assume he is too.
>
> > However, isn't that exactly the same as the inheritance of individual
> > components, which we are specifically told doesn't happen?
>
>
> It does rather seem that way. But I would assume it means that what is
> inherited is the end result of combining the short forms and any
> complete forms for a given FO, rather than any indidividual component
> specification.
> We can also interpret this statement simply to mean that one must write:
> "space-before='inherit'" rather than
> "space-before.precedence='inherit'". I would assume this holds for
> functions such as "from-parent()" as well. Then it at least makes more
> sense. But it also says that if one of the components is set using a
> "complete form specification", only that component is overriden. So one
> could write:
>
> space-before="inherit" space-before.precedence="force"
> which would use all the previously specified values except that for the
> precedence component.
Yes. And a note to 5.9.12 Expression Value Conversions, says
<quote>
Conversions of compound property values are not allowed; thus for
example, space-before.optimum="inherited-property-value(space-before)"
is invalid. Permitted are, for example,
space-before="inherited-property-value(space-before)" and
space-before.optimum="inherited-property-value(space-before.optimum)"
since they do not require conversion.
</quote>
(What it doesn't say is whether
space-before="inherited-property-value(space-before.optimum)"
which is the obvious question that arises. I can't imagine it would be
invalid, but then...)
>
> For those few compound properties which can actually be inherited (such
> as word-spacing),
>
> it would seem to imply that setting a single component of the property
> using the complete form modifies only that part of the inherited value.
I'm with you and Arved.
> On the other hand, if we stick to the letter of what is written, it
> would seem that using a short-form specification such as
> "word-spacing='1pt' would mean that the inherited value is totally
> ignored, and the precedence and conditionality components which aren't
> specified are set to their initial values. I must say that this seems
> rather inconsistent.
I agree with Arved here on the way to look at the consistency of this.
(And I've just discovered an error in my approach to shorthand
expansion. I had misread to spec to mean that all of the possible
properties affected by a shorthand are set to initial values, then the
properties which are actually set in the shorthand expression are
modified. In fact, only the properties directly affected by the
shorthand expression are set as a result of the shorthand. Properties
which come within the ambit of a shorthand, but which are not
specifically mentioned in the expression are processed as though the
shorthand expression had not been encountered. In the absence of any
individual settings, they will receive intial values or inherited values
depending on their inheritability.)
> If I recall correctly, the current FOP functionality will only use the
> inherited value if neither a short form nor any complete component form
> is specified on a particular FO. As soon as either a short form or a
> complete form is used, the remaining components are filled in from the
> initial values.
The last sentence I don't follow. Why should the setting of an
individual value, through a complete form, trigger the a reset of all
other component values? In this case -
space-before="4.0pt"
space-before.maximum="6.0pt"
- it doesn't. I fear you have a way of looking at this which eludes me.
In terms of what you say above, the space-before setting has triggered
the full reset, but that is its specific function. The spec does say:
<quote>
Compound values of properties are inherited as a unit and not as
individual components. After inheritance any complete form specification
for a component is used to set its value.
</quote>
Peter
--
Peter B. West pbwest@powerup.com.au http://www.powerup.com.au/~pbwest/
"Lord, to whom shall we go?"
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org
RE: Compound property inheritance
Posted by Arved Sandstrom <Ar...@chebucto.ns.ca>.
> -----Original Message-----
> From: Karen Lease [mailto:klease@club-internet.fr]
> Sent: August 25, 2002 7:11 PM
> To: fop-dev@xml.apache.org
> Subject: Re: Compound property inheritance
>
[ SNIP ]
> For those few compound properties which can actually be inherited (such
> as word-spacing),
>
> it would seem to imply that setting a single component of the property
> using the complete form modifies only that part of the inherited value.
This is exactly how I understand it.
> On the other hand, if we stick to the letter of what is written, it
> would seem that using a short-form specification such as
> "word-spacing='1pt' would mean that the inherited value is totally
> ignored, and the precedence and conditionality components which aren't
> specified are set to their initial values. I must say that this seems
> rather inconsistent.
It is not inconsistent if we assume that a short-form like
word-spacing="3pt"
means _precisely_ "Such a specification gives that value to each
of the <length> components and the initial value to all the non-<length>
components."
It does NOT mean "Such a specification gives that value to each
of the <length> components."
The initial value assignments for non-<length> components is an integral
part of this short-form.
[ SNIP ]
Arved Sandstrom
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org
Re: Compound property inheritance
Posted by Karen Lease <kl...@club-internet.fr>.
Hi Peter,
These things will tie your brain in knots...
Peter B. West wrote:
> Devs,
>
> I've raised this question before, but I am still uncomfortable with
> compound inheritance, so I will try again for a developer consensus.
>
> 5.11 Property Datatypes has:
>
> "Compound values of properties are inherited as a unit and not as
> individual components. After inheritance any complete form specification
> for a component is used to set its value."
>
> Let's assume, for the purpose of the discussion, that "space-before" is
> inheritable. According to 5.11,
>
> <quote>
> space-before="4.0pt"
>
> is equivalent to a specification of
>
> space-before.minimum="4.0pt"
> space-before.optimum="4.0pt"
> space-before.maximum="4.0pt"
> space-before.precedence="0"
> space-before.conditionality="discard"
> </quote>
>
> and
>
> <quote>
> Short forms may be used together with complete forms; the complete forms
> have precedence over the expansion of a short form. For example:
>
> space-before="4.0pt"
> space-before.maximum="6.0pt"
>
> is equivalent to a specification of
>
> space-before.minimum="4.0pt"
> space-before.optimum="4.0pt"
> space-before.maximum="6.0pt"
> space-before.precedence="0"
> space-before.conditionality="discard"
> </quote>
>
> At this point, what is the inherited value of space-before? If the idea
> of a compound is that the value of the compound is the sum of its parts,
> then "inherited as a unit" would mean
>
> space-before.minimum="4.0pt"
> space-before.optimum="4.0pt"
> space-before.maximum="6.0pt"
> space-before.precedence="0"
> space-before.conditionality="discard"
That's what I think it means.
> However, isn't that exactly the same as the inheritance of individual
> components, which we are specifically told doesn't happen?
It does rather seem that way. But I would assume it means that what is
inherited is the end result of combining the short forms and any
complete forms for a given FO, rather than any indidividual component
specification.
We can also interpret this statement simply to mean that one must write:
"space-before='inherit'" rather than
"space-before.precedence='inherit'". I would assume this holds for
functions such as "from-parent()" as well. Then it at least makes more
sense. But it also says that if one of the components is set using a
"complete form specification", only that component is overriden. So one
could write:
space-before="inherit" space-before.precedence="force"
which would use all the previously specified values except that for the
precedence component.
For those few compound properties which can actually be inherited (such
as word-spacing),
it would seem to imply that setting a single component of the property
using the complete form modifies only that part of the inherited value.
On the other hand, if we stick to the letter of what is written, it
would seem that using a short-form specification such as
"word-spacing='1pt' would mean that the inherited value is totally
ignored, and the precedence and conditionality components which aren't
specified are set to their initial values. I must say that this seems
rather inconsistent.
If I recall correctly, the current FOP functionality will only use the
inherited value if neither a short form nor any complete component form
is specified on a particular FO. As soon as either a short form or a
complete form is used, the remaining components are filled in from the
initial values.
Karen
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org