[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Inheritance
Hi, I'm trying to come up with spec wording regarding inheritance. I copied the relevant pieces from the CSS specification. I don't know yet, if we have a need for the same, more elaborate, or simpler model than what CSS defines. I tried to adapt the wording to WebCGM. Please read it and provide comment on the questions I raised (bottom of email). Also feel free to ask more questions. --- 1 Style attributes Local table of content goes here. 1.1 Specified, computed, and actual values WebCGM 2.0 user agents are required to support the inheritance model defined in this section. Once a user agent has loaded a document and constructed a document tree, it must assign, for every Application Structure in the tree, a value to every style attributes. Very similar to the CSS model, the final value of a style attribute is the result of a four-step calculation: the value is determined through specification (the "specified value"), then resolved into a value that is used for inheritance (the "computed value"), then converted into an absolute value if necessary (the "used value"), and finally transformed according to the limitations of the local environment (the "actual value"). 1.1.1 Specified values User agents must first assign a specified value to each style attributes based on the following mechanisms (in order of precedence): 1) If the style attribute is assigned a value, use it. 2) Otherwise, if the style attribute is inherited and the Application Structure is not the root of the document tree, use the computed value of the parent Application Structure. 3) Otherwise use the style attributes's initial value. The initial value of each property is indicated in the style attribute's definition. 1.1.2 Computed values Specified values are resolved to computed values after the document tree is create; for example relative units ('%') are computed to absolute values (i.e., RGB color or NVDC). Computing a value never requires the user agent to render the document. When the specified value is not 'inherit', the computed value of a style attribute is determined as specified by the Computed Value line in the definition of the property. See the section on inheritance for the definition of computed values when the specified value is 'inherit'. The computed value exists even when the property doesn't apply, as defined by the 'Applies To' line. However, some style attributes may define the computed value of a style attribute for an Application Structure to depend on whether the style attributes applies to that Application Structure. 1.1.3 Used values Computed values can be relative to each other; for example 'hmmm... need to find one'. The used value is the result of taking the computed value and resolving these dependencies into a final absolute value used for the actual display. 1.1.4 Actual values A used value is in principle the value used for rendering, but a user agent may not be able to make use of the value in a given environment. For example, a user agent may only be able to render borders with integer pixel widths and may therefore have to approximate the computed width, or the user agent may be forced to use only black and white shades instead of full colour. The actual value is the used value after any approximations have been applied. 1.2 Inheritance Some values are inherited by the children of an element in the document tree, as described above. Each style attribute defines whether it is inherited or not. When inheritance occurs, elements inherit computed values. The computed value from the parent element becomes both the specified value and the computed value on the child. 1.2.1 The 'inherit' value Each style attribute may also have a specified value of 'inherit', which means that, for a given element, the property takes the same computed value as the style attribute for the Application Structure's parent. The 'inherit' value can be used to strengthen inherited values, and it can also be used on style attributes that are not normally inherited. --- Questions: - Should we rename style attributes to become "properties", a la CSS? - Should we allow the 'inherit' value? (ex: visibility="on | off | inherit") - Do we have the concept of Specified, computed, and actual values in WebCGM? I'm not convinced we have computed values relative to each other in WebCGM (ex: can a stroke-weight depend on character-height which depends on intensity value?) - I'm missing a line about inheritance and 'grnode'. Actually I think that what we said about 'grnode' is that they behave 'as if' all its style attributes were set to 'inherit'. -- Benoit mailto:benoit@itedo.com
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]